Oil prices surged by up to 37 cents a barrel on the New York Mercantile Exchange Friday as confidence rose that OPEC will cut its output when its latest production-sharing accord takes effect Jan. 1.

West Texas Intermediate, the benchmark U.S. crude for immediate delivery, climbed 37 cents to $16.72 a barrel in trading on the New York Mercantile Exchange. Oil for delivery in February and subsequent months recorded gains of 24 cents to 31 cents a barrel.

In U.S. Gulf Coast spot trading, where oil is sold to the highest bidder, West Texas Intermediate gained 15 cents to $16.50 a barrel.

Prices for refined products also ended sharply higher. Gasoline prices shot up by nearly a penny and a half a gallon on news of a fire at an Amoco oil refinery in Texas, while home-heating oil added to gains earlier this week as sub-freezing temperatures persisted in the northeastern United States.

Unleaded gasoline for January delivery gained 1.48 cents to 45.13 cents a gallon on the Merc. Home-heating oil ended 1.08 cents higher at 52.02 cents a gallon.

Robert Baker, senior energy analyst for Prudential-Bache Securities Inc. in New York, said market participants want to believe the Organization of Petroleum Exporting Countries will end its excess production _ which exacerbated a worldwide surplus of crude supplies and pushed down prices by one-third between April and November.

Until the last few days, however, skepticism had abounded that the 13-nation cartel would fail to observe the terms of a production-restraint accord adopted last month that calls for a 4 million barrel-a-day reduction in total daily output of to 18.5 million barrels.

"Overall, the market is simply mirroring the ebb and flow of confidence in OPEC's ability to observe the new agreement," Baker said, adding that he believes the answer will not become clear until at least mid-January. Right now, he said, "you can get any story you want . . . and that is part of the problem."

In European spot trading, the United Arab Emirates' Dubai light _ the key OPEC crude from the Middle East _ edged down 1 cent to $12.70 a barrel. Britain's widely traded North Sea Brent crude slipped 5 cents to $15.45 a barrel.

The official OPEC news agency reported that the national oil company of Abu Dhabi, one of the two key oil producing states in the Emirates, has notified customers of a 14 cent-a-barrel price increase retroactive to Nov. 1. OPECNA quoted a company spokesman who said the price increase was in line with "positive" market developments since November.