President Reagan, facing difficult congressional challenges in the next few months on a host of domestic and international priorities, admonished Republicans yesterday not to attack the administration for their political gain.

In remarks at the end of a closed Cabinet meeting, Reagan said he believed there would be no benefit or advantage to those in his party who turn on his administration. A senior White House official described Reagan as issuing a "shot across the bow" at restive Republicans who have been increasingly vocal in criticism of Reagan on trade issues, the deficit and agriculture.

"Now's the crunch, now's the time to go along, and be Republicans," the White House official said in summarizing Reagan's remark, which followed a briefing on the troublesome congressional challenges coming up on spending bills, the debt ceiling, trade, the farm bill and South Africa, among other current issues.

At the same time, the Cabinet yesterday was given more details about the continuing deterioration in the near-term deficit outlook. Joseph R. Wright Jr., acting director of the Office of Management and Budget, reported that a $19 billion cut in defense spending for next fiscal year has been "virtually negated" by recent increases in domestic spending and a $14 billion revenue loss caused by slower-than-expected economic growth.

Wright reported that next year's deficit is still hanging near $180 billion, and may go higher, even with Reagan's compromise on defense spending. "Unless congressional intransigence on domestic spending is broken, the president's proposed deficit reduction targets will not be met" next year, Wright said in a document presented to Reagan and the Cabinet.

Reagan's remark urging Republicans to support the administration appeared to parallel the thinking of two senior GOP strategists. Stuart K. Spencer, a veteran Reagan political adviser, discussed Republican Party problems with the president during a luncheon last week at Reagan's California ranch.

Spencer said later that he had told the president that Republicans should close ranks behind him because "if the Reagan administration didn't do well, they're not going to do well" in the 1986 elections.

Officials said that White House political adviser Edward J. Rollins has also been making the case that Reagan's current high approval rating is an important asset to GOP lawmakers seeking reelection next year, and thus it would be counterproductive for Republicans to attack Reagan.

Senate Republicans have been increasingly independent of the White House this year. Under Majority Leader Robert J. Dole (R-Kan.) they have threatened to go their way on budget issues, producing some open conflict with White House chief of staff Donald T. Regan.

Both Democrats and Republicans may confront Reagan with a host of protectionist trade bills this autumn, which the president has promised to veto.

With 22 GOP Senate seats at stake in 1986, Rollins believes that Reagan's strong standing with American voters and the economy are the two factors that could make or break close Senate races, officials said.

Rollins has also argued that Reagan should avoid "running against Congress" in the months ahead because it could lead to a polarization with Capitol Hill that could hurt Senate Republicans.

In the Cabinet meeting, the first since his return from a three-week California vacation, Reagan appeared somewhat irritated and dismayed by recent reports of GOP squabbles.

In remarks that one official called "forceful," Reagan said Republicans would be held responsible as a group for the way they ran the government in the next few months. "We're in power," he was quoted as saying.

The president added that no individual GOP members could gain or get political advantage by running their campaign against the White House, the official said.

Defense Secretary Caspar W. Weinberger told the Cabinet that he agreed, given Reagan's approval ratings over 65 percent, officials said.

Reagan engaged in some lively give-and-take with senior officials in the Cabinet meeting, and several said afterward they were reassured that he is plunging back into business.

The meeting also included a foreign policy review by Secretary of State George P. Shultz.