Brent crude futures were up $0.54 at $64.20 a barrel by 1230 GMT after hitting a session high of $64.46.
West Texas Intermediate crude futures were up $0.32 at $57.10 a barrel after the US benchmark hit a session high of $57.32.
Iran said the vessel, which it did not identify, was smuggling fuel and had been carrying 1 million litres, or around 6,200 barrels. It was captured near Iran's Larak Island in the Gulf.
Britain pledged to defend its shipping interests in the region and US Central Command Chief General Kenneth McKenzie said the United States would work "aggressively" to enable free passage after recent attacks on oil tankers in the Gulf.
"The oil price reaction on Thursday shows once again that the conflict in the Middle East is far from solved and tensions could flare up any time," UBS analyst Giovanni Staunovo said. "As oil keeps flowing, prices are likely to rise only temporarily," Staunovo added.
Iran said the vessel impounded was the same one it towed on Sunday after the ship had sent a distress call. US officials said on Wednesday they were unsure whether an oil tanker towed into Iranian waters had been seized or rescued.
Reuters reported on Wednesday that shipping companies were hiring unarmed security guards for voyages through the Gulf as an extra safeguard.
Oil had fallen on Wednesday in response to a sharp rise in US stockpiles of products such as gasoline that pointed to weak demand during the US driving season.
Data from the US Energy Information Administration showed a larger-than-expected drawdown in crude stockpiles last week.
Gasoline stocks rose by 3.6 million barrels, however, compared with analysts' expectations in a Reuters poll for a 925,000-barrel drop.
The gasoline build was "especially remarkable in the week after the Independence Day weekend", analysts at Commerzbank wrote.
The summer driving season normally entails increased consumption of gasoline.
US President Donald Trump's threat to impose additional tariffs on China has also pressured oil prices, with nerves on edge over when talks between the two countries will resume to resolve a trade war that has slowed global growth.
Barclays on Thursday lowered its oil price forecasts for the second half of this year and 2020.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ