The Christian Democratic Party of President Jose Napoleon Duarte took a substantial lead as votes were slowly counted today in El Salvador's election, but no single party appeared likely to win enough votes to govern alone.

After about 40 percent of the votes had been counted, the Christian Democrats were ahead with 36.7 percent of the vote, according to the electoral commission. The rightist party of former major Roberto D'Aubuisson was running a strong second with 25.3 percent, while another conservative party, the Party of National Conciliation (PCN), was third with 14.2 percent. The Democratic Alliance had 8.3 percent. There was no official explanation of why the vote counting took so long.

With the early returns indicating that no party is likely to win an absolute majority, U.S. Ambassador Deane R. Hinton brought rival party leaders together to stress the need for them to agree on some form of broad-based coalition government.

The meeting among the leaders of the six parties that contested the election for a constituent assembly was held over lunch today at the tightly guarded hillside home of the U.S. envoy. Seven of the eight official observers the United States sent to assess the fairness of the elections also were in attendance.

The political meeting in the capital came as government soldiers, backed by armored cars and helicopter gunships, moved against leftist guerrillas who Saturday occupied the provincial capital of Usulutan, 69 miles east of here, as part of their campaign to sabotage the elections. The leftist parties have said the level of violence in this country, where more than 30,000 reportedly have been killed in 2 1/2 years, made their participation in the election impossible and dangerous.

The team of observers sent by the U.S. government said an estimated 1.2 million people went to the polls in the election, which had been challenged by guerrilla threats, acts of sabotage and attacks. U.S. officials said this number represented 83 percent of the eligible voters. There will be no official report of the turnout, however, until all the ballots have been counted.

D'Aubuisson, at a news conference after his luncheon with the U.S. ambassador, said that his National Republican Alliance, known here as ARENA, and the three other rightist parties that contested the election would form their own coalition government "within a few days." Sources close to the Party of National Conciliation said, however, that the party has not yet made a commitment to any specific coalition plan.

The U.S. government was maneuvering to prevent formation of a governing coalition that would exclude the Christian Democrats, according to a U.S. official.

Based on the partial results, Christian Democratic officials predicted that they would gain 26 seats in the 60-member assembly. ARENA was expected to gain 17 seats, according to the sources, and the PCN 14. Democratic Action a small party which the Christian Democrats had counted on to form a coalition, was expected to gain 3 seats.

This would give a conservative coalition between ARENA and PCN 31 seats, a bare one-seat majority that would hardly represent the broad-based government U.S. officials are hoping will be formed here.

Because the vote was held under a system of proportional representation, the number of seats each party holds in the assembly will not correspond exactly to the percentage of the popular vote it wins. The assembly will be empowered to write a constitution, name an interim government and organize elections for a new, permanent government.

The new government will have to work out its relationship to El Salvador's powerful security forces, which have dominated the country's political life for half a century.

The election was held up by the Salvadoran government and the Reagan administration as a test of the popular support for the civilian-military government, which is locked in a struggle against a coalition of guerrilla groups and leftist political organizations that had called for a boycott of the vote.

The most notable absentee at the meeting at the U.S. ambassador's residence, which U.S. officials portrayed as an informal "get-together," was Duarte, the president of the current junta that is expected to be replaced as soon as Salvadoran politicans can agree on a coalition to govern the nation until a new constitution is drawn up and new elections can be held, probably in 1983.

U.S. officials said Duarte was not invited to the luncheon because he was not the official head of his party, which was represented by Julio Rey Prendes, a former mayor of San Salvador.

Privately, a U.S. source said Duarte had intentionally been excluded from the meeting because of the animosities between him and various parties on the right, particularly ARENA, which has emerged from the election as a new, and some say dangerous, political power in the country.

One source close to the talks said today that an agreement that Duarte step aside could well be the price the Christian Democratic Party will have to pay to form a coalition with its previous antagonists.

D'Aubuisson arrived at the luncheon with Hinton in a buoyant mood over the strong showing that the right-wing parties had made in the balloting.

"There was an atmosphere of euphoria" at the meeting, said one U.S. official who attended. He added that there would be further meetings of the six parties, although it was not clear if the United States would continue its open involvement in the postelection power brokering.

It was not known whether the party leaders had engaged in detailed bargaining or if they had discussed in any way compromises on key issues in the campaign and the war, such as negotiations with the guerrillas or the land reform program the Christian Democrats had pushed in the junta that has ruled El Salvador since a coup in October 1979.

"I see a process of political negotiation and I hope a pulling together and reconciliation of the democratic parties," Hinton said early today.

At the luncheon, the only solid agreement among the parties was to refrain "from crying fraud" about the election results, according to a participant.

"Everything else is up in the air," he said.

The large turnout, labeled by U.S. electoral expert Howard Penniman as "one of the most amazing expressions of popular will I have ever seen," was being portrayed by many as the biggest defeat for the five leftist guerrilla bands in the mountains since their unsuccessful "final offensive" in January 1981.

But while the guerrillas were unable to prevent people from trooping to the polls, they did show surprising new strength and depth in the countryside.

This was illustrated by their capture of Usulutan, in the heart of the country, where voting was canceled because of the fighting. The guerrillas also staged simultaneous attacks on 13 other cities and towns in their election offensive that began Saturday.

Because the Christian Democratic Party had been expected to make a good showing, the big surprise of the election was the emergence of D'Aubuisson, 38, who has been accused of involvement in the assassination two years of Archbishop Oscar Arnulfo Romero, as well as several attempted coup d'etats and assorted armed attacks on the fortified U.S. Embassy here.

All participants were exultant over what several said could be a turnout of more than a million voters.

"That's the same number we had in 1972, but then it was because of total fraud and ballot box stuffing," said one government official. In that election, Duarte, as a candidate of a moderate coalition, was believed to have won by more than 100,000 votes. However the Army, which had been the dominant political force in the country for 50 years, took control of the electoral commission and when the final results were announced, Gen. Carlos Humberto Romero was declared the victor by 100,000 votes. Duarte was arrested, tortured and finally sent into exile to Venezuela, whence he emerged in 1979, after Romero's overthrow by a coup by reformist Army officers.