The new contract between the United Auto Workers union and General Motors Corp.--approved by the narrowest of margins Thursday--guarantees neither jobs nor profits for the two sides, company and union officials agree.

It does, however, give both sides the chance to close the gap in production quality and efficiency that now heavily favors Detroit's Japanese rivals by creating a closer partnership between management and workers.

And that could perhaps be worth as much as the $2.5 billion to $3 billion in estimated labor cost concessions agreed to by GM's UAW workers.

GM Chairman Roger Smith said this week that the pact "opens a new chapter in American labor relations" with its commitments to profit sharing and job security by GM, and the agreement by the UAW to defer cost-of-living pay increases and give up nine annual paid personal holidays and annual wage boosts for the next 30 months.

According to UAW President Douglas Fraser, the new agreement will provide an increase in pay and benefits of about $3.50 an hour over the next 30 months compared with a $5 increase had the UAW been able to renew its current contract.

The concessions do not eliminate the labor cost advantage the Japanese now enjoy, GM President James McDonald said recently. "It doesn't make us competitive worldwide. It doesn't even make us competitive with . . . industrial wages in the United States," he said.

But it "clearly signals a move for us in a new direction--away from confrontation and toward cooperation," said GM's chief negotiator, Alfred S. Warren Jr.

The goal of both sides is to strengthen GM by reducing absenteeism, waste and plant inefficiency through improvements in the working conditions and climate within plants. The vote is likely to be followed by more negotiations at plant level on these issues.

The narrow margin of the GM vote, however, is a measure of the distance that remains to be traveled in that direction.

The final count was 114,468 union members in favor of the contract, or 52 percent, with 105,090 opposed. The agreement, covering some 470,000 working and laid-off UAW-GM members, will take effect Monday, even though the formal signing is not scheduled until Friday.

"The closeness of the vote makes it clear that this was a very difficult and painful step for our UAW-GM members, yet one taken in an attempt to address our problems in these very troubled economic times," Fraser said.

Fraser said some workers resented statements by Smith in January suggesting that GM would close plants unless a new contract with the UAW was reached.

"He's the figurehead of the corporation, and they don't like him," Fraser said. "All we had to do was have Roger Smith give a speech in favor of it, and we're done."

The union's chief negotiator with GM, Owen Bieber, said UAW members were also put off by GM's 1981 profit of $333 million--a figure that overstated GM's actual financial condition, according to industry analysts, because of favorable foreign currency transactions.

"The GM workers see a profit report in, and it's a big company, and they just didn't recognize the seriousness that the union leadership did," Bieber said. To union members it cast doubt on the necessity of sacrifice, UAW officials said.

So, too, did GM's continued dividend payments to shareholders this year, in contrast with Ford's decision not to pay dividends for the first and second quarters.

Ford's new contract with the UAW was approved by almost a 3-to-1 margin.

Fraser said yesterday that the GM agreement is slightly better for the union than the Ford pact because GM is rescinding decisions to close plants, providing a more generous profit-sharing plan, and making it easier for laid-off workers to qualify for the new guaranteed income provisions provided senior union workers in the new contract.

GM--like Ford--made an unprecedented commitment to the union not to close plants simply to obtain parts and components from foreign or cheaper, nonunion sources in this country. Both companies have agreed to discuss in detail future decisions on plant closings and purchasing that are critical to the union's job security concerns--discussions that would have been impossible just a few years ago, before the industry's deep sales slump.

"The new contract should stop the hemorrhaging of our jobs and bring many thousands of our laid-off members back to work," Fraser said. But even if the contract does fulfill the hopes of the auto companies and the union, it will take time.

Car production at the U.S. automakers this week was estimated to be down 37 percent from the corresponding period in 1981. The companies will build 94,311 autos, down from 149,415 in the week a year ago, according to Ward's Automotive Reports.

And the new-car production scheduled by the companies for the second quarter of the year is the lowest figure in 20 years.

Wrung almost dry financially by the sales slump, the companies are keeping the brakes on car production until sales show a clear, strong sign of improvement.

That isn't expected to happen at the earliest until after consumers receive the individual tax increases due in July, and it may not occur even then.