SANTA BARBARA, CALIF., AUG. 22 -- President Reagan will put the Soviet Union and Nicaragua on notice this week that they must match positive words with democratic deeds if they expect to improve relations with the United States, administration sources said today.

They said that the president, in a speech in Los Angeles on Wednesday, will pointedly revive the Reagan Doctrine calling for military aid to "democratic insurgents" opposing communist regimes.

He intends to express a "resolute commitment" to promoting democracy worldwide and specifically pledge support to contras opposing the leftist Sandinista government of Nicaragua and anticommunist rebels in Afghanistan, these sources said.

Reagan will emerge from the seclusion of his mountaintop ranch northwest of here, where he has been vacationing since Aug. 13, for this speech on U.S.-Soviet relations. Thursday, he plans to meet again with contra leaders and receive a briefing from their military commander, Enrique Bermudez.

Reagan's advisers said one purpose of this activity is to mollify conservatives expressing alarm at what they see as appeasement tendencies in an administration battered by the Iran-contra scandal and presided over by a president anxious to leave a positive foreign policy legacy.

Some conservatives have said they believe that Reagan may be overeager for a summit with Soviet leader Mikhail Gorbachev centered on signing an agreement to remove medium- and short-range nuclear missiles from Europe and Asia.

They fear that Reagan, with the encouragement of White House chief of staff Howard H. Baker Jr., may make unnecessary concessions on verification procedures for such a treaty.

Conservatives have expressed even greater concern that Reagan is likely to abandon the contras in return for promises of democratic changes in Nicaragua. They share the view of contra leaders that the Sandinistas will quickly break their promises if rebel forces are disbanded.

White House officials also mistrust the Sandinistas. But they scoff at the notion that Reagan will jettison deeply held anticommunist convictions to bolster his legacy with an unenforceable Central American peace treaty or U.S.-Soviet arms pact.

"We're not going to sign an arms-control treaty that doesn't provide for adequate verification, and we're not going to accept a Nicaraguan peace plan without democratic reforms," a senior official said here last week.

This official said there is no contradiction between Reagan's assertion that he will "not desert the contras" and his conditional praise for a pending Nicaraguan peace proposal accepted by five Central American nations, including Nicaragua.

The official said the contras and the peace plan are "mutually reinforcing" because the rebels' presence provides pressure on the Sandinistas to restore civil liberties and hold free elections.

So far, however, the administration's balancing act has failed to satisfy liberal critics of the contras or conservative opponents of the Central American peace proposal.

Paul Weyrich, leader of a group of conservatives who met with Reagan before he left for his vacation, last week denounced the statement of a White House spokesman who said the president was seeking a "middle course" in Central America.

"There is no middle way when it comes to the lives of the freedom fighters," Weyrich said. "If we abandon them, as we have abandoned virtually anyone who has tried to fight communism since the end of World War II, then their blood will be on the hands of whoever is responsible."

In the view of White House officials, such statements reflect an ideological luxury that ignores the political reality of public and congressional opposition to the contra cause.

Political obstacles facing the administration were underscored Friday by a Los Angeles Times poll showing that 48 percent of voters oppose contra aid, while 34 percent support it.

The same poll found voters evenly divided on the issue after fired National Security Council aide Marine Lt. Col. Oliver L. North testified last month before congressional committees investigating the Iran-contra affair.

Despite this public skepticism and suspicion about the administration Central American policy on left and right, White House legislative liaison William L. Ball III said "there is a significant body of realistic congressional sentiment in the middle."

Ball and other White House officials said members of Congress of both parties are likely to base their decision on continuing contra aid on the Sandinistas' behavior in weeks ahead.

"Are they going to continue breaking up demonstrations with clubs and cattle prods, or are they going to allow freedom of assembly?" a White House official asked last week. "Will La Prensa be allowed to resume publishing? Will political prisoners be released?"

Officials here said the Sandinistas' answer to such questions will determine whether Reagan seeks more military aid for the contras when the current appropriation expires Sept. 30. Administration officials said the contras would have enough military aid from the current appropriation to remain in the field until Oct. 20 and enough nonlethal supplies to exist as an organized force for a few weeks beyond that.

"The problem isn't that they're going to run out of gas on Sept. 30," a senior official said. "The question is whether there are going to be any more gas stations."

In his Los Angeles speech, to be televised live to a U.S.-Soviet conference in New York, Reagan plans to review U.S.-Soviet relations since the 1945 accord among allied leaders in Yalta.

U.S. officials said he will reiterate his desire for the pending pact on medium-range nuclear weapons and express continued interest in a more far-reaching agreement on strategic nuclear arsenals. He will continue to avoid the harsh rhetoric of his first term, when he called the Soviet Union "the evil empire."

But aides said Reagan will insist that superpower relations can improve only if both sides deal frankly with the entire spectrum of their relationship, including regional conflicts as the struggle in Nicaragua. Staff writer David Hoffman contributed to this report.