U.S. energy companies' shares climbed premarket on Wednesday, propelled by gains in oil prices on concerns that an escalation of tensions in the Middle East could threaten supplies.

Iran's missile attack on Israel, and Washington's full backing of its ally on a response against Tehran, sent markets into a risk-off mode. Safe-haven currencies like Japan's yen and Swiss franc saw strong bids, along with oil and defense stocks.

Benchmark Brent crude prices rose 2.8% to $75.59 a barrel, while U.S. crude gained 3% to $71.92. [O/R]

"The involvement of Iran is a particularly troublesome development for markets, with investors rightly fearful that retaliation from Israel could disrupt global oil supplies," said Matthew Ryan, head of market strategy at financial services firm Ebury.

Iran is a key player in the global oil market and accounts for about 5% of oil production.

U.S. energy majors Exxon Mobil and Chevron rose 1.6% and 1.5%, respectively.

Major oil and gas producers ConocoPhillips, Occidental Petroleum and Devon Energy gained between 1.5% and 1.9% while oilfield services firm SLB and Halliburton both rose about 2% each.

Analysts expect the market to remain "jittery" as investors await Israel's retaliation and the resultant impact on supply.

"The wider implication for markets is the rising possibility of a sharp move higher in global oil futures, and another period of elevated energy prices and consumer inflation," Ryan added.

"The ramifications will not, however, be as severe as following the Ukraine invasion."

Shares of U.S. defense companies Lockheed Martin and RTX were also up about 1.5% each premarket.

Bouts of global geopolitical unrest have driven brief gains in defense stocks during the last three years on anticipation of higher weapons demand.