Canada's main stock index ended barely lower on Wednesday, dragged down by resource stocks but paring sharper losses after minutes from the last Federal Reserve meeting showed mixed opinions on when conditions may allow for higher U.S. interest rates.

The Toronto Stock Exchange's S&P/TSX composite index ended down 5.84 points, or 0.04 per cent, at 14,697.60, after falling to its lowest in more than a week earlier in the session. It hit a 13-month high last week.

Energy stocks stayed low despite a turn higher in oil prices that extended the commodity's rally to five days, as investors weigh up how sustainable the gain in crude prices to near the top of a $40-to-$50-a-barrel range would be.

"The stocks pulling back would tell me that people aren't convinced that this rally is going to keep going," said Colin Cieszynski, senior market analyst at CMC Markets Canada.

The energy group retreated 0.6 per cent overall, with major producer Suncor Energy Inc (SU.TO) down 0.7 per cent to $36.33 and pipeline company Enbridge Inc (ENB.TO) off 0.5 per cent at $53.43.

The minutes from the Fed's July meeting showed that some policymakers see a need to tighten policy soon while the U.S. central bank still wants to see more supportive economic data before pulling the trigger.

"Both the bulls and the bears were able to take away things from it," CMC's Cieszynski said.

The Dow Jones industrial average closed up 21.92 points, or 0.12 per cent, to 18,573.94, the S&P 500 had gained 4.07 points, or 0.19 per cent, to 2,182.22 and the Nasdaq Composite had added 1.55 points, or 0.03 per cent, to 5,228.66.

The materials group, which includes precious and base metals miners and fertilizer companies, lost 1.2 per cent.

Gold miners were a particular weight, as bullion prices steadied after the Fed minutes.

Barrick Gold Corp (ABX.TO) shed 2.2 per cent to $26.78 and Goldcorp Inc (G.TO) lost 1.7 per cent to $23.76.

Six of the Canadian index's 10 main groups finished in positive territory, while decliners outnumbering advancers by a ratio of 1.2-to-1.

Valeant Pharmaceuticals International Inc (VRX.TO) jumped 12.6 per cent to $38.51 after Morgan Stanley raised its rating and price target on the stock.

Performance Sports Group Ltd (PSG.TO) slumped 14.8 per cent to $2.30 after the sports equipment maker said it was facing an investigation by U.S. and Canadian securities regulators, two days after it said it was conducting an internal probe into its financials.