MANAGUA, Nicaragua (AP) _ Contra rebels hit an electrical substation in northern Nicaragua with mortar fire early Tuesday, killing two watchmen and cutting off power to two provinces, the Defense Ministry said.

In a radio broadcast in neighboring Honduras, the Nicaraguan Democratic Force, one of several Contra groups, claimed responsibility for the ttack.

The Defense Ministry, in a communique issued Tuesday night, called the attack ''a propaganda ploy'' to obtain further U.S. support.

It identified the two watchmen as Alonso Rios and Santos Alvarado, but gave no further details.

Government spokeswoman Angela Zelaya said of the substatio she said was worth $1.5 million, ''We don't know ... if it was destroyed or not, only that this morning it was still in flames. The substation is about 40 miles from the border with Honduras, where the Contras are based.

A regional official in the area, who spoke on condition of anonymity, said the attack cut electricity supplies to the northern provinces of Nueva Segovia and Madriz. The station is 125 miles northeast of Managua in the Esteli province town of Yalaguina, but the official said it doesn't serve that province.

In telephone conversations Tuesday night, residents of Somoto, capital of Madriz province, and of Ocotal, capital of Nueva Segovia, said they were still without electricity and weren't told by authorities when power would be restored. The residents asked not to be identified for security reasons.

Electricity went off in Managua early in the afternoon and later was restored. Whether the outage was related to the attack was not clear, but there are frequent power cuts in the capital.

It was the third significant attack this month by the U.S.-backed rebels fighting Nicaragua's leftist Sandinista government.

Contras burned six large warehouses March 11 at a tobacco cooperative 185 miles north of Managua.

Last Friday, rebels attacked the town of San Pedro de Lovago, 95 miles east of the capital. Nicaraguan authorities gave no details on the raid.

Rebels of the Nicaraguan Democratic Force claimed to have downed a Soviet- made MI-8 helicopter Saturday near Wiwili, in the northern province of Jinotega. There was no confirmation.

Frank Arana, a spokesman for the Democratic Force, also known as FDN, claimed in a radio broadcast Tuesday that 200,000 people in 20 communities were left without electricity as a result of the attack. He also claimed the rebels destroyed a Sandinista military garrison near the power installation.

The broadcast over the rebels' clandestine Radio September 15th, monitored Tuesday night in the Honduran capital of Tegucigalpa, made no mention of casualties.

Arana said Ocotal, Pueblo Nuevo, Palacahuina Totogalpa, San Lucas and El Espino were among the towns or cities blacked out.

In the broadcast, Arana described the Sandinista garrison as being heavily manned and equipped but gave no details. He said that, after the attack, the FDN forces ''withdrew to more secure locations'' in Nicaraguan territory.

The Defense Ministry communique made no mention of an attack on the garrison, but claimed that Sandinista troops killed 115 rebels, wounded 30 and captured seven in fighting during the past nine days in northern and central Nicaragua and along the Atlantic coast. But it gave no details.

The Sandinista newspaper Barricada claimed Tuesday that the United States has paid more than $1 billion for spy missions and aid to the Contras in an attempt to overthrow the government.

It said 40 spy flights over Nicaragua were made last year by planes from MacDill Air Force Base in Florida; Fort Ord, Calif.; Honduras; Costa Rica, and Panama.

''These millions of dollars have been converted to bring more pain and death to the Nicaraguans,'' the newspaper said. ''The American taxpayers continue paying, while their own government tightens the screws to eliminate various social programs, in order to feed the guerrilla forces developed by the United States.''

The U.S. Congress is to vote Thursday on President Reagan's proposal to provide $100 million in aid the Contras.

Barricada said some of the alleged $1 billion went for warships, troop movement and air strips in Honduras, ''which would permit the silent transfer of the 82nd airborne - the same group that invaded Grenada'' in October 1983.

U.S. and Honduran armed forces have staged numerous joint exercises in the territory of Nicaragua's northern neighbor since 1982.