The Reagan administration today sought to use pending talks between leftist guerrillas and the president of El Salvador as a challenge to Nicaragua to take a similar initiative with its own opponents and as an indirect criticism of the more protracted peace process of the Contadora treaty negotiations.

The U.S. approach was outlined aboard Secretary of State George P. Shultz's airplane en route here for a four-hour visit with President Jose Napoleon Duarte. It appeared to be an effort to regain the peacemaker initiative seized last month by Nicaragua when it announced it would sign unconditionally the proposed Contadora treaty for regional peace.

In a letter to Duarte, read by Shultz on his arrival at the international airport here, President Reagan applauded the Salvadoran president for proposing talks with the guerrilla coalition that has been trying to overthrow the government here since 1979. Shultz was heading for Panama, where he is to attend the inauguration of President Nicolas Ardito Barletta.

Duarte's "offer is an act of statesmanship," Reagan said. "If only the comandantes in Nicaragua would make the same offer to resistance forces there, we would all be much closer to true peace in Central America." Reagan was referring to Nicaragua's Sandinista rulers by their guerrilla military title in Spanish.

The phrase "resistance forces" referred to U.S.-backed rebels against the Sandinista government of Nicaragua, forces that Reagan has previously called "freedom fighters." Nicaragua has refused to talk with rebel leaders, calling them U.S. puppets.

As the focus in Central America has shifted over the past several weeks from military to political activities, participants in the region's various conflicts occasionally have been at pains to maintain the diplomatic high ground.

The Reagan administration long has opposed talks between the Duarte government and the Salvadoran guerrillas, and Salvadoran sources here said U.S. diplomats expressed skepticism when Duarte's plan first was revealed to them Saturday. Once Duarte went ahead, however, the administration publicly supported it and today moved to shift attention back to its complaints against Nicaragua.

Before his arrival here, Shultz told reporters today that he gave unconditional support to Duarte's "bold, imaginative" proposal.

"In a way, he's saying you don't have to wait around for some treaty to be signed; let's get going, let's have behavior. After all it's behavior that counts," Shultz said.

At a news conference this afternoon with Shultz, Duarte said he had not yet decided whether Salvadoran military commanders will accompany him to the talks, as the guerrillas have demanded.

"I am the commander of the Army," Duarte said, "and therefore, according to the constitution, I represent the Army. I will select the people who will accompany me in the discussion." If members of the high command were to attend, he said, they would come "not as members of the armed forces, but as my personal advisers in this political matter."

Duarte has asked to speak directly to the guerrilla military commanders, rather than their political spokesmen, during the meeting scheduled for Monday morning in the town of La Palma, 40 miles north of here. The guerrillas, Duarte has said, represent the real power on the left.

By the same token, the guerrillas, who said in accepting Duarte's offer yesterday that they would bring the politicans anyway, asked Duarte to bring his own military commanders on grounds that they, too, held more power than the politicians in Duarte's government. Duarte said the guerrillas could bring "anybody they want."

Duarte personally notified Defense Minister Gen. Carlos Eugenio Vides Casanova of his proposal on Saturday, and the general and his aides spent the weekend notifying local commanders around the country, Salvadoran officials said. While conservative officers have resisted talks with the left in the past, a military source said that "they're letting him Duarte do his thing for the moment."

The conservative political opposition also has been relatively restrained in its comments about the proposed talks. Former major Roberto D'Aubuisson, leader of the right-wing Nationalist Republican Alliance, on Monday called the proposed talks "a farce," but his comments since then have been less harsh.

One reason for the right's restraint has been Duarte's insistence that he will not offer to negotiate over granting the rebels a share of power as they have demanded in the past. He emphasized again today that he would stick to the Salvadoran, and U.S. government's, position that the left could gain power only by participating in elections.