The Toronto Stock Exchange turned to a loss late Monday even as commodities were buoyed by improved sentiment about the global growth story and amid a dividend announcement by corporate behemoth Apple Inc.

The S&P/TSX composite index was down 17.27 points to 12,479.7. The junior TSX Venture Exchange shed 7.39 points to 1,598.78.

The Canadian dollar was up 0.45 of a cent to 101.27 cents US.

April oil prices rose $1.03 to US$108.09 a barrel, while gold prices gained $11.50 to US$1,667.30 an ounce. Copper prices added three cents to US$3.91 a pound.

Commodity prices moved higher on improved confidence that the world economy is improving — which would mean an increase in demand for resources — as European debt fears faded slightly and signals point toward a rebound in the U.S. economy.

“The market for some time has been baking in a pretty dire scenario in Europe,” said Canadian market analyst Craig Fehr at Edward Jones.

“I don’t think there’s been full acknowledgment, or at least the market hasn’t been willing to fully embrace yet, the idea that the U.S. economy is improving,” Fehr said.

“You start to add up a few of these things and you get a global growth story that looks like it might be getting a bit of steam and that really is what’s going to drive commodity prices longer term, when you think about the consumption that’s going to occur in China, how much consumption comes out of the U.S. when that economy is growing.”

Commodity prices had been helping prop up the TSX all day, but the market began shedding points just before the close. That was partly due to a decline on the influential materials sector, despite higher gold prices.

Higher commodity prices sent the energy sector on the TSX higher, with shares in Suncor Energy (TSX:SU) up 54 cents to C$33.46. However, the heavyweight materials sector fell, with shares in Kinross Gold (TSX:K) down 12 cents to $9.78. while the mining sector also moved lower, with shares in Teck Resources (TSX:TCK.B) down 16 cents to $36.59.

However, a spike in oil prices, amplified by tensions with oil-rich Iran, is a double-edged sword for the economy as higher prices at the pump mean consumers have fewer disposable dollars to spend on other goods, Fehr noted.

Meanwhile, a relatively slow week for economic news started off with a big announcement from the corporate world, as Apple Inc. (Nasdaq:AAPL) said it would pay a dividend for the first time since 1995.

Not only is that good news for Apple shareholders, Fehr said, but also it is a “symbol of something much bigger” in that corporations flush with cash may start deploying capital.

Apple introduced a quarterly dividend of $2.65 per share and started a $10-billion share buyback program. Shares added 2.7% or $15.53 to US$601.10. Apple is sitting on $97.6 billion in cash and securities.

For years, it has resisted calls to reward shareholders with some of that money. But since the death of CEO Steve Jobs, management has signalled that it’s been considering options for the money.

“It’s good for Apple shareholders but…it’s a better reflection of what the broad market is experiencing right now and investors have a great opportunity to get into quality companies with rising payouts,” Fehr said.

Wall Street markets closed higher, with the Dow Jones industrial index up 6.51 points to 13,239.13, the Nasdaq up 23.06 points to 3,078.32 and the broader S&P 500 adding 5.58 points to 1,409.75.

Statistics Canada reported Monday morning that wholesale sales slipped one per cent in January to $49 billion, largely because of lower sales of motor vehicles and parts. The agency said it was the second decrease in three months after a general upward trend that began last May.

In an otherwise quiet week for economic data, investors will look to Canadian retail sales numbers for January coming out Thursday and February’s Consumer Price Index on Friday.

Traders will also take in the latest reports on U.S. housing starts and sales figures for new and existing homes later in the week.

Economists expect housing starts rose by 0.3% last month, while existing home sales gained 0.7% and new home sales climbed by 1.4%.

On Monday, data showed homebuilders’ feelings about the current U.S. housing market haven’t changed from February. But many are growing more optimistic that sales could pick up in the coming months.

The National Association of Home Builders/Wells Fargo says its builder sentiment index was unchanged this month at 28, the highest level since June 2007. The flat reading followed five straight increases. But builders said they are more hopeful about sales over the next six months.

In Canadian corporate news, grain handler Viterra Inc. (TSX:VT) said Monday that it was in exclusive talks with a potential buyer of the company. Viterra confirmed last week that it had established an auction process and acknowledged reports that said offers would need to be at least $16 per share. When stock resumed trading after a morning trading halt, shares lost 1.7% or 24 cents to $15.97.