TORONTO -- The Toronto stock market closed modestly higher Tuesday as traders balanced economic data showing a better than expected read on U.S. retail sales against the standoff over raising the U.S. government's debt ceiling.

The S&P/TSX composite index gained 38.89 points to 12,641.97, led by advances in gold stocks and defensive sectors, including telecoms and utilities. The TSX Venture Exchange gained 2.26 points to 1,231.79.

Fitch Ratings warned Tuesday that the United States could lose its top credit rating for the second time if there's a delay in raising the ceiling.

Congress has a March 1 deadline to increase the country's debt limit or face a potential default. There are fears that the debate will descend into the sort of squabbling and political brinkmanship that marked the last effort to raise the ceiling in the summer of 2011.

"People are concerned about it," said John Stephenson, portfolio manager at First Asset Funds Inc., but added that he doesn't expect a repeat of the summer of 2011 when a large number of newly elected Tea Party Republicans held up the increase.

"(The) thing that's become apparent to the market is the Republicans don't have the muscle (to do that) anymore."

The Canadian dollar closed down 0.03 of a cent at 101.62 cents US as worries about raising the debt ceiling strengthened the greenback. The U.S. currency is perceived to be a safe haven for money managers and often gains strength in times of turmoil.

The Dow Jones industrials gained 27.57 points to 13,534.89 as the U.S. Commerce Department reported that December retail sales were up 0.5 per cent, better than the 0.2 per cent rise that economists had expected.

The Nasdaq dropped 6.72 points to 3,110.78, and the S&P 500 index added 1.66 points to 1,472.34.

Stephenson added the tone on markets early in 2013 is much more positive.

"People are starting to differentiate between good performers, bad performers. It's not like it's, oh geez, Europe is blowing up, sell everything," he said.

"When we see days like today when the market is weak, we're not seeing a lot of selling. We're really seeing reluctance to sell. And on the days when it's stronger we're seeing reluctant buying but we're not seeing anyone throwing the baby out with the bathwater."

The gold sector was the biggest advancer, up about 0.85 per cent as February bullion gained $14.50 to US$1,683.90 an ounce. Barrick Gold Corp. (TSX:ABX) was ahead 36 cents at C$34.03 and Goldcorp Inc. (TSX:G) improved by 38 cents to $36.86.

The utilities sector was up 0.76 per cent with Canadian Utilities (TSX:CU) 86 cents higher to $73.99.

The telecom sector gained 0.56 per cent as BCE Inc. (TSX:BCE) ran ahead 43 cents to $42.54.

The base metals sector was up 0.24 per cent as March copper on the New York Mercantile Exchange shed early losses and closed unchanged at US$3.64 a pound. Inmet Mining (TSX:IMN) climbed 68 cents to C$70.43.

Anglo American Platinum, the world's largest platinum producer, said it will close some South African mines and sell another, cutting 14,000 jobs. The announcement came only months after South Africa suffered massive labour unrest along with 46 deaths in the mining sector.

Anglo American said a financial review concluded that four mine shafts needed to be closed and one mine sold because of unprofitable operations.

On the TSX, Eastern Platinum (TSX:ELR) gained 3.5 cents or 15.22 per cent to 26.5 cents.

February crude closed 86 cents lower at US$93.28 a barrel. The energy sector rose 0.4 per cent and Cenovus Energy (TSX:CVE) rose 33 cents to C$33.70.

The information technology sector led losses, down 1.05 per cent as Research In Motion Ltd. (TSX:RIM) gave back some of Monday's 10 per cent surge, down 43 cents to $14.27. Elsewhere in the group, Celestica Inc. (TSX:CLS) fell 13 cents to $8.17.

Elsewhere in the tech sector, Facebook shares were down 2.74 per cent to US$30.10 after CEO Mark Zuckerberg unveiled a new search feature. Called "graph search," the new service lets users search their social connections for information about people, interests, photos and places. Until now, Facebook users were unable to search for friends who live in a certain town or like a particular movie.

And Apple fell $15.83 or 3.15 per cent to US$485.92. The stock hasn't closed below $500 in almost a year. Apple slumped 3.6 per cent Monday on concern that demand for its iPhone 5 is slowing.

Corporate earnings from the fourth quarter also focused traders attention. The calendar Tuesday was relatively light but Wednesday will see the release of key earnings reports from the American banking sector, including JPMorgan Chase and Goldman Sachs group.

In Canada, Corus Entertainment Inc. (TSX:CJR.B) will raise its dividend by more than six per cent. The entertainment and media company announced the increase late Monday as it reported higher first-quarter earnings. Net income attributable to shareholders was $52.2 million or 62 cents per diluted share, up three per cent from the year-earlier period.

However, Corus said its consolidated revenues slipped to $226.1 million, down five per cent from $236.9 million the previous year. Corus shares gained 22 cents to $24.45.

Lululemon Athletica Inc. (TSX:LLL) shares fell $2.93 or 4.12 per cent to $68.24 after it said Monday that it now expects diluted earnings per share of 74 cents for the current quarter. That compared with earlier guidance of between 71 and 73 cents per share. But it forecast revenue near the $475 million to $480 million previously forecast, below analyst expectations of $488.1 million.