TORONTO, April 22 (Reuters) - Canada's main stock index on Wednesday clawed back some of the previous day's steep decline as resource shares rose and investors cheered an extended ceasefire in the Middle East.

The Toronto Stock Exchange's S&P/TSX Composite Index ended up 146.81 points, or 0.4%, at 33,955.11. On Tuesday, the index posted its biggest drop in a month, falling 1.6%.

 Iran seized two ships in the Strait of Hormuz, tightening its grip on the strategic waterway after U.S. President Donald Trump called off attacks with no sign of peace talks restarting.

"As long as this on-again and off-again war continues, market volatility is going to be high," said Michael Sprung, president at Sprung Investment Management.

"The day to day machinations of the market are revolving somewhat around the Strait of Hormuz and energy prices. I think beyond that the implications of inflation and possibly stagflation are beginning to settle into people's consciousness."

The halting of traffic in the strait has led to an oil price shock, boosting inflation. Data on Monday showed that Canada's annual inflation rate rose to 2.4% in March, from 1.8% in February.

U.S. crude oil futures settled 3.8% higher at $92.96 a barrel, which helped lift the energy sector by 1.3%.

The U.S. Supreme Court rejected Enbridge's bid to change the venue of an environmental lawsuit by Michigan seeking to force the Canadian energy company to stop operating an oil pipeline between two of the Great Lakes. Shares of Enbridge were down 0.2%.

The materials group added 1.4% as gold and copper prices rose.

Rogers Communications shares jumped 13.5% as the telecom company reported quarterly revenue slightly above analysts' average estimate and forecast 2026 capital expenditure about 30% below 2025 levels.

Consumer staples was one of five major sectors to post declines. It lost 0.9%, with shares of Metro down 2.7% after the grocery retailer said the Laval labor dispute will have an impact on the company's third-quarter results.

(Reporting by Fergal Smith in Toronto and Tharuniyaa Lakshmi in Bengaluru; Editing by Sahal Muhammed and Deepa Babington)

By Fergal Smith