Oil prices posted their biggest daily gains in a month, rising to fresh 3½ year highs Wednesday after President Donald Trumppulled the U.S. out of the Iran nuclear pact, triggering renewed economic sanctions that could reduce the oil supply of an already increasingly tight market.

U.S. crude futures rose 3.01% to $71.14 a barrel on the New York Mercantile Exchange. Brent, the global benchmark, rose 3.15% to $77.21 a barrel on ICE Futures Europe.

In...