Stepping in to referee a bitter Cabinet dispute, President Reagan yesterday overrode the strong objections of Office of Management and Budget Director David A. Stockman and authorized Energy Secretary James B. Edwards to sign a Union Oil synfuels contract -- just in time to rescue his energy chief from a contempt-of-Congress citation.

Reagan's decision, which was never announced by the White House but was disclosed by an administration official, promptly led the House Government Operations Committee to cancel a vote set for today on a subcommittee resulution citing Edwards for contempt of Congress.

"We had the votes by a big margin and they knew it," said Rep. Toby Moffett (D-Conn.), chairman of the energy subcommittee that had earlier cited Edwards for refusing to provide subpeonaed documents concerning the Union Oil Co. contract to build an oil shale plant in Colorado. The project could cost the government $400 million, since the Defense Department is promising to purchase the plant's entire production, at a price guaranteed by the Energy Department.

Energy officials said that now that the contract is being signed, Edward will furnish the Moffett subcommittee with all the documents it requested.

The Union Oil contract was one of three synfuels projects under consideration for loan guarantees that had ignited perhaps the most acrimonious battle yet within President Reagan's frequently fractious cabinet government.

Energy Department officials, while basking in yesterday's victory for their boss, said the president's Union Oil decision did not necessarily mean that the other two projects would also be approved. The battle over synfuels goes on, the said.

The personal battle inside the Reagan inner circle, however, left Edwards and Stockman barely on speaking terms.

"The bitterness is all one-sided -- that's what's so weird," said a senior aide to Stockman. "Dave is not the one who is bitter. But it didn't have to be raised to such tension levels."

Edwards, who is a low-key contrast to the hard-charging director of the Office of Management and Budget, concedes that there may be bad feelings. But he hastens to add, "Well, it's not on my part, anyway. . . . I'd like to believe that Dve Stockman was sincerely trying to help me. . . . I'd like to believe he was."

At issue is the fact that Stockman, in his zeal to end all government aid to synthetic fuels programs, wound up working with Moffettt's subcommittee in the hope of outflanking Edwards, who has become a champion of the synfuels cause. This left the energy secretary doing a slow burn.

"Either I'm being taken in by you," Edwards say he told Stockman at one point, "or you're being taken in by Moffett." Edwards, clearly upset by it all, makes no secret that he thinks it is the former.

At issue also is whether Stockman went so far as to ultimately bestow his quiet blessing upon the subcommittee's vote that last week cited Edwards for contempt of Congress.

Stockman denies it. His aides concede that they worked with Moffett to make sure the synfuels projects were accorded a long and thorough congressional investigation, one that would delay their federally guaranteed funding.

But Stockman aides maintain that their concerns were philosophical, not fratricical -- and they deny that they advocated the contempt citation that stemmed from Edwards' refusal to give the subcommittee the documents it subpoenaed on the Union contract.

But Edwards remains unconvinced.

"Strange things do happen u here in Washington," says Edwards, who learned his politics as the governor of South Carolina, but saysd he is just beginning to get educated about the way Washington works. "I'd like to believe that it didn't happen. I'd like to believe."

But he says he has heard that it did.

Moffett, meanwhile, confirms that he decided to press ahead with the contempt of Congress vote in his subcommittee after a conversation between his chief aide and Stockman's. But as Moffett tells it, any encouragement Stockman gave was tacit, not overt.

"There was a noticeable change in attitude from Stockman calling me every day in the recess, when I was in Connecticut and saying, 'Don't go through with this contempt citation,'" Moffett said. The change he says -- to a series of inquiries that Stockman helped Moffett and his staff frame.

"Then suddenly, after we got that insulting reply from Edwards, there was nothing from Dave Stockman," says Moffett. "No more pleas for a delay."

There was, however, the phone call from Las Vegas, word of which has made the rounds. The energy secretary has heard of it -- and it makes him furious. The industry lobbyists have heard of it -- and it makes them wonder.

It was from Stockman's associate director for energy, Frederick N. Khedouri, to Moffett's subcommittee staff director, John Galloway, and it has assumed an importance all its own in the controversy.

"I heard there were some telephone calls from Khedouri," says Edwards. "I heard he called the members of the committee, giving them some instructions [about the comtempt vote]."

Galloway says Khedouri never urged that the committee go ahead and cite Edwards for contempt, but that he did not repeat the previous requests for a delay in the vote. In the call, Khedouri says, Galloway expressed the view that the contempt citation could be enforced even if Edwards subsequently provided the subpoenaed documents.

Khedouri says he urged Galloway to let Edwards' legal advisers know that. "I was not encouraging them to do it [cite Edwards for contempt]," Khedouri says. "I was encouraging them to convey their attitudes."

The call reportedly ended with Khedouri telling Galloway to "have fun" at the upcoming subcommittee meeting. But Khedouri explains: "I say that to a lot of people."

One side issue that has left all of the principals puzzled is the way presidential counselor Edwin Meese III intervened in a bid to head off that contempt citation vote. In a threat that Stockman, Edwards, Moffett and their aides consider bizarre, Meese is said to have twice warned that the White House in turn would accuse Moffett's entire subcommittee with violating the Corrupt Practices Act if it persisted in seeking the DOE documents before the Union contract was signed.

The subcommittee's ranking Republican, Rep. Joel Deckard of Indiana, says Meese made the threats to him in phone calls last week. Meese's effort failed, as Deckard was the only Republican to vote for the contempt citation, providing the crucial margin in the final 6 to 4 subcommittee vote.

When Moffett's subcommittee subpoenaed DOE's records on the Union Oil contract, in an effort to ascertain that the deal was being overseen properly, Stockman saw his opportunity. He volunteered his good offices to head off the subcommittee's effort to enforce its subpoena upon Edwards.

Stockman telephoned Moffett in the role of an eager negotiator. According to Moffett, Stockman asked that the committee delay citing Edwards for contempt. In turn, Stockman promised to get the subcommittee the documents it wanted.

In the meantime, he pledged, he would withhold his own certification, required by law, that the funds are available to guarantee the loans. Thus the subcommittee would be assured that the contracts could not be completed while the negotiations over the documents were under way.

As mediator, Stockman had the rationale he wanted for blocking the projects. When Edwards learned of what Moffett said Stockman had promised, he was furious. And in his low-key way, he quickly made this known to the director of OMB.

They agreed to meet in Moffett's office. But Stockman showed up 45 minutes late, which further angered the ever-punctual Edwards. The two barely spoke to each other, other participants say.

And after about 20 minutes, Edwards got up to leave. "I have an appointment," Edwards said cooly to his Cabinet colleague. "I think it is discourteous to keep people waiting, Dave."

Eventually, Reagan had to involve himself in the controversy and chaired a Cabinet council on it last week. There, Stockman pulled out a photograph of another oil shale project, Gulf and Amoco's Rio Blanco site, offering it as proof that a plant could be started without government subsidies.

Edwards say in puzzled silence. Later, the secretary conferred with aides and wrote Reagan a letter saying that Gulf and Amoco in fact had applied for loan guarantees of an unspecified amount.

Asked about Stockman's photograph, Edwards now says: "It was rather misleading, in a way."