MANAGUA, NICARAGUA, JAN. 24 -- The war came to Managua this week when television screens showing Nicaragua's all-time favorite soap opera went dark.

Electricity is under emergency rationing here for the first time in six years of fighting between the leftist government and the U.S.-backed rebels, who blew up several key electrical towers in the north. This weekend the lights are off for as much as five hours a day.

Energy Minister Emilio Rappaccioli said electricity had to be cut to many neighborhoods in the evening because of unmanageable peak demand from television sets -- including his own -- tuned to a steamy Brazilian serial that has the city spellbound.

In the final weeks before the U.S. Congress is expected to vote on renewing aid to the rebels, known as contras, a spiral of shortages and malfunctions is introducing Managuans to new levels of warborne deprivations. Although the battles are fought in faraway mountains and jungles, the capital city is more than ever a wreck.

Gasoline and power shortages have fouled up the telephone service. Many switchboards require electricity to function. Some operators cannot get to work on time because their cars' gas tanks are empty. Last week, Cardinal Miguel Obando y Bravo, the mediator in the quest for cease-fire talks between the government and the contras, told journalists he planned to report to the contras' negotiators in Miami about some late developments, "that is, if the telephone works. . . ."

Water has been turned off two days a week in Managua for the past three years. But because many neighborhoods rely on electric pumps, many city dwellers now have water only a few hours a week. Merchant Justa Balmaceda, 49, from the Barrio Mexico neighborhood, said she stayed up until 2 a.m. several nights last week, waiting for shower water.

Basic foods, such as beans and cooking oil, are in dwindling supply. Some economists predict more acute shortages this spring, when farmers cope with inflation, catapulting 50 percent per month, by warehousing their crops as long as possible to sell at higher prices.

One official after another has gone to the public with his woes, each new problem compounding the last.

At a press conference, Rappaccioli said the extra strain on the power grid from the contra attacks forced the state electric company to ration. But turning the flow off and on strained the system and caused a boiler crack and a "rotor deficiency" in two generators in Managua.

The capital is running on two old plants, which Rappaccioli described as "completely out of date," while his technicians scramble to replace parts unobtainable from the manufacturer because of the three-year-old U.S. trade embargo. Nicaragua needs 235 megawatts of electricity per day and is getting only 145, the minister said.

One of the Sandinista city government's most popular civic accomplishments in 1987 was to put lights in Managua's baseball stadium for night games of the national sport. It took years of planning and scrimping to install the lights late last year. Night games have been canceled until further notice.

Daytime power cut-offs have closed factories and paralyzed offices that rely on air-conditioning to function in Managua's 85-degree afternoon heat.

Several restaurants have gone dark in the middle of dinner, sending their patrons home hungry as perishables spoiled.

"I came home from work last week to sit in the darkness. One night the power came back on so strong it blew out my refrigerator. We're getting it coming and going," grumbled shoe seller Mayra Silva, 28.

According to Emilio Canales, head of operations for the state petroleum company, Nicaragua reached the bottom of its gasoline barrel late last month and will not have adequate supplies until early next month.

For three weeks, Nicaraguans have been lining up their cars in the middle of the night at the few gas stations with fuel, and thus causing traffic jams. In queues of hundreds of cars, they wait as long as a day for five gallons of gas, the maximum ration per person.

Canales complained that the northwestern port of Corinto is not designed for unloading the big, slow-moving Soviet tankers that bring the precious fuel, usually later than scheduled. Soviet crude yields less gasoline than Venezuelan and Mexican oils that once supplied Nicaragua's refinery, Canales said. The plant is owned by Exxon.

The Soviet Union supplied 400,000 tons of crude to Nicaragua in 1987 -- 100,000 more than its original commitment, official figures show. But Nicaragua was still 50,000 tons short of its needs at the end of the year. As the leftist Sandinista government has used up its credit with regional suppliers, only Soviet Bloc nations have remained willing virtually to contribute petroleum to Nicaragua.

Grim news is also arriving from the countryside. Agrarian Reform Minister Jaime Wheelock issued an urgent call yesterday for volunteer laborers to pick up an estimated $10 million worth of coffee beans that fell during heavy rains. Coffee is one of Nicaragua's main exports.

"The country's at war. All this is normal. We just have to adapt," commented Silva, the shoe vendor, with a resignation many city dwellers expressed.

But housekeeper Felix Gonzalez Giron, standing at the door of the lower middle-class home she cleans, railed, "The government didn't want us to know about what the contras are doing. But now we can see the contras aren't going to leave the Sandinistas in peace, and the government can't hide it anymore."

A number of Managuans said they were confused about the politics behind the conflict and longed for a settlement and peace. A housewife and grandmother named Maria Lidia Espinosa said, "I wish the contras and the Sandinistas would agree to fight their war on a mountain way up by the border, and just leave us alone."