Nicaraguan President Anastasio Somoza agreed yesterday to a nationwide referendum on his presidency proposed by a U.S.-led mediation team in a final effort to peacefully resolve the crisis that has divided his country.

Opposition spokesmen contacted by telephone in Managua last night said, however, that the conditions Somoza set for the referendum were unacceptable to them and would be rejected. The opposition has called a meeting for early this morning.

Perhaps more important than whether Somoza's offer will actually lead to a vote on his continuance in office is that the announcement provided enough of a concession to keep the mediation talks alive, if only for one more day.

After both Somoza and the opposition initially rejected the plan on Nov. 24, the mediators, from the United States, Guatemala and the Dominican Republic, gave both sides until noon yesterday to reconsider and threatened to give up and go home if the proposal was again rejected outright.

Somoza called his offer a "patriotic decision" and implied that it had been taken only to avoid renewed bloodshed between the government's National Guard and Sandinista Liberation Front guerrillas. In September, the Sandinistas led an anti-Somoza civil war that they have threatened to resume at any moment.

The announcement was the first time Somoza has indicated that he might, under certain conditions, step down before the expiration of his term in 1981.

Asked why he had changed his mind, Somoza said "in politics, only the rivers never run backwards."

But despite Somoza's concession, it remains unclear whether the mediators' plan will be acted on. Spokesmen for the Broad Opposition Front coalition of political, labor and civic groups that has been negotiating with Somoza said their initial reaction to the announcement was negative.

Although the mediators' plan had called for a simple vote on whether Semoza would remain in office, with Somoza agreeing beforehand to resign should he lose, Somoza's acceptance of the basic proposal included a number of conditions.

Among them was the stipulation that the referendum be between continuing Somoza's presidency and establishing a "constituent assembly." Should he lose that vote, Somoza's plan calls for another election to select the assembly, which would then select a new president and form a provisional government.

Somoza said, however, that all political parties, including the Sandinistas could participate in the assembly elections.

But he refusea the opposition's principal demand that he leave the country during the electoral period.

The opposition spokesman said they had suspicions of any referendum plan that did not include a provision for Somoza's immediate resignation in the event he lost. "The Broad Front," one opposition tactician said, "has conceded all that it can. We consider Somoza's statement a refusal -- albeit a little more flexible, and a little more intelligent, than previous refusals."

The opposition demand that Somoza leave the country was part of conditions it offered for its own acceptance of the mediation proposal, announced Wednesday night in advance of the deadline.

The opposition also "suggested" that the National Guard be confined to its barracks for 15 days prior to a referendum, rather than the three days suggested by the mediators. The opposition also suggested that a new National Guard director be named to replace Somoza as commander in chief and set several conditions for the location and manning of voting booths.

Somoza said yesterday that he could not comment on whether his Liberal Party, which theoretically is making all decisions on behalf of his government, would accept those decisions.

But even though each side in the mediation has in effect turned down the mediators' plan by setting conditions sure to be rejected by the other, their ostensible acceptance of the basic idea of a referendum gives the mediators additional manuvering room.

Among the options that the United States, which is the principal force in the mediation effort, might choose to exercise is the use of additional diplomatic or economic pressure on either Somoza, the opposition, or both, to make them more flexible.