The president’s proposal to impose a fee on shipping in the Strait of Hormuz threatened to increase global energy prices.