The prospect of renewed U.S. aid to the Nicaraguan rebels, known as contras, is increasing political tension among Costa Rican officials and complicating the U.S. position here.

In interviews this week, the new leaders of the avowedly neutral democratic government said they are caught between their opposition to the contra program and their dire need for U.S. aid, as well as their hope for U.S. help in renegotiating a crippling foreign debt.

President Oscar Arias, who has been in office two months, has tried to stress areas of agreement with Washington -- for example, by leading other Central American nations in pressing Nicaragua for democratic reforms during regional peace talks.

But now the contras have pledged to open a major military front in southern Nicaragua, along the Costa Rican border, as soon as the new military aid begins to flow. That could be as early as Sept. 1. President Reagan's $100 million military and nonlethal aid package won House approval last month and is also expected to pass the Senate. For Costa Rica, "that means trouble, much more trouble," in the form of a new flood of refugees, violence along the border, and greatly increased contra traffic there, said Interior Minister Guido Fernandez.

"This is a test for us. We must prove to the international community that we are really neutral . . . by deeds, not words, showing that we want them the contras outside our borders," Fernandez said. He was named this week to be Arias' new ambassador to the United States.

Arias met with his Council of Ministers on Tuesday to discuss the situation and yesterday spelled out his limits in an interview.

"Costa Rica will not be converted into a dormitory for contras," he said. "I am not going to look the other way . . . they may live here, they may speak to the press, they may take advantage of our freedoms . . . but they may not use Costa Rican territory for any kind of military act."

He said the ban includes training, troop transport and resupply depots.

Arias has made similar statements in the past, before the new aid was approved, but with only 1,500 Civil Guards and 50 Rural Guards available to police the 200-mile jungle border, the contras have moved relatively freely in and out.

Fernandez, who oversees the Rural Guard, has tried to enforce Arias' stand by confiscating a few arms caches, but both men acknowledged that a quantum leap in contra activity of the predicted scope will be impossible for Costa Rica to control.

At the same time, it will generate increased pressure on Arias from Costa Ricans unable to find jobs because of the influx of refugees and from border communities affected by the fighting, Arias said. Refugees from Nicaragua and El Salvador already approach 10 percent of Costa Rica's 2.6 million population, and a recent upsurge in polio, measles and dysentery has been traced to refugees in northern Costa Rica.

Another official, asking not to be named, said the country's position that fighting not take place in Costa Rica was made clear to U.S. Ambassador Lewis A. Tambs. The official said Tambs would be held personally responsible and might possibly be asked to the leave the country if any serious breach by the contras is discovered.

Tambs said he respects Arias' position. "The war is in Nicaragua; the war is not in Costa Rica," he said. "Costa Rica has a position of neutrality, and we don't have any intention of violating it." He agreed that a major contra presence in Costa Rica could weaken Arias and said, "I intend to stop it from happening." Asked how, he replied, "Well, we will have some control over the money."

Strategists here said the contras could operate their southern front without involving Costa Rican territory if their troops are airlifted to attack positions in Nicaragua and are resupplied by air. Costa Rica would not object to wounded troops being treated in Costa Rican facilities or to contras resting here, as long as there are no camps or other fixed facilities.