Shares of energy companies rose along with oil prices as reports of an Iranian attack on a cargo ship in the Strait of Hormuz raised concerns about how smooth the reopening of the waterway will be.

Iran's Islamic Revolutionary Guard Corps. attacked a Singapore flagged cargo ship in the Strait of Hormuz on Thursday, according to two senior U.S. officials, testing the deal to end the fighting and reopen the vital shipping lane that the U.S. and Iran signed only last week.

Oil companies Chevron, Eni and Repsol said their operations continue in Venezuela on Thursday, a day after powerful earthquakes killed more than 160 people. The companies said their assets remain operational after two earthquakes hit the north of the country at 5 p.m. local time Wednesday. A 7.2-magnitude quake was quickly followed by a second, 7.5-magnitude quake, killing an estimated 164 people and leaving 1,000 people injured.

Write to Patrick Sullivan at patrick.sullivan@wsj.com

(END) Dow Jones Newswires