Nicaraguan President Daniel Ortega returned today from a controversial trip to the Soviet Union and other countries and said an agreement had been reached by which Moscow will supply Nicaragua with 80 to 90 percent of its petroleum needs in 1985.

Ortega said he visited Cuba and 13 nations in Eastern and Western Europe during a 25-day trip in search of economic and political support for his government. The oil agreement with the Soviets was the only commercial pact he mentioned during a press conference after his arrival, and he gave no details on the terms of the agreement.

"This does not mean that Nicaragua is aligned with the Soviet Union," he said when asked about possible criticism of the new agreement. "There are Western European nations that buy oil from the Soviet Union . . . and are not aligned politically with that country."

After Ortega met Soviet leader Mikhail Gorbachev on April 29, the Soviet news agency Tass reported that Ortega was told that Moscow "will continue to give friendly Nicaragua assistance in resolving urgent economic problems and also political and diplomatic support," but there was no specific mention of what form any new aid might take.

Sandinista officials claimed late last year that they received about 40 percent of their petroleum from the Soviets in 1984. Some oil industry and diplomatic sources claimed that it was actually more than 50 percent.

The rest of the country's oil needs -- about $170 million per year, according to the government -- were being filled by Mexico. Ortega stressed Monday that his government understood that Mexico is going through serious economic problems and no longer can afford to provide Nicaragua with petroleum. The Nicaraguans are known to owe Mexico at least $300 million in unpaid petroleum bills.

Iran also has supplied oil to Nicaragua to be sold to third countries for cash as a form of balance of payments support.

Other sources have insisted that Mexico has been under strong political pressure from the Reagan administration to cut off the flow of oil to Nicaragua.

The timing of the trip caused some members of the U.S. Congress who voted against aid to Nicaraguan rebels April 23 to say they might change their votes when the proposal is brought up again. Ortega tried to defuse that sentiment.

"The U.S. government is trying to manipulate the purpose of our trip," he said.

He insisted that the trip to Moscow was necessary because of Nicaragua's pressing need to find petroleum. He said that he had talked briefly to Gorbachev during funeral ceremonies for his predecessor Konstantin Chernenko earlier this year but that no agreement had been reached, and a subsequent visit was necessary.

He also said that when the trip was scheduled in April he then believed that there would be no vote in Congress on aid to the rebels until May and thought his trip and the vote would not coincide.

But Ortega also emphasized that members of Congress who had visited Nicaragua before the vote and later voted against the aid "were never promised that we would break relations with the Soviet Union.

"The results of this trip will not solve Nicaragua's economic problems," Ortega said. He said his government was pressing for increased aid from other Western and Eastern European countries, to help keep alive what he called "an economy of survival."

He also said such increased aid "will show the United States that it cannot conquer Nicaragua, not militarily or economically. It will show them that the policy of economic strangulation will not conquer Nicaragua."