Venezuela, South America's most vigorous democracy and one of the few remaining on the continent, will elect a new president today after a year of heated campaigning.

The race between Luis Pinerua and Luis Herrera, representing the oil-rich country's two largest political parties in a field of 10, could be the closest in the 20 years of democratic government that have followed the demise of Venezurela's last military dictator.

Venezuelan polls give both Pinerua and Herrera approximately 35 per cent of the ballots in a contest where all citizens over the age of 18 are required by law to vote.

The voting law normally is not strictly enforced but turnout is expected to be high, despite the fact that the two front-runners are remarkably similar in both political background and platform.

Diplomatic observers of the race describe them as the "Tweedledee and Tweedledum" of Venezuelan politics. Both in their mid-50s, Pinerua, of the ruling Democratic Action party (AD), and Herrera, of the Social Christians (known by their local acronym COPEI), are longtime party stalwarts who worked their way up over two decades of partisan politics.

Both have promised to maintain Venezuela's strong position in the Organization of Petroleum Exporting Countries, to straighten out and improve grossly inadequate public services, to halt growing urban crime and even to bring color television to the country's big-spending middle and upper classes.

Neither is expected to make sharp changes in foreign or domestic policy. Perhaps in echo of the "back to basics" approach of populism and international morality that brought Jimmy Carter to office, however, each has implied he will bring Venezuela back down to earth after the heady, often flamboyant five-year term of current President Carlos Andres Perez.

Perez, who is constitutionally prohibited from running again for 10 years, has commanded the biggest national income, and the biggest expenditures, in Venezuelan history -- more money made and spent than in the three preceding presidential terms combined.

The money came from 1974 price increases for oil. Most of Venezuela's abundant supply is sold to the United States. Until two years ago, most of the industry was owned by U.S. companies. Perez nationalized it in a remarkably smooth transition that is considered his principal achievement.

Perez is also credited - and sometimes criticized by Venezuelans who find him inattentive to domestic problems -- with making his foreign policy a force not only in the Americas but, through oil, worldwide. While he has recently pressed for OPEC price increases as a way to tax big powers for their economic advantages over the Third World, he has been a strong ally of Carter, particularly in the area of nuclear policy and international human rights.

But in gaining control over its oil and in implementing a massive development plan designed to bring Venezuela's 12 million people into the industrial world, Perez spent even more money than Venezuela was making.

Initially he failed to give high priority to agriculture. As more peasants and farmers came to the cities to seek a slice of the oil boom, Venezuela turned from agricultural self-sufficiency to become a major food importer.

As the cities became overcrowded, housing and public transportation became inadequate. Water and electricity are turned off in some parts of Caracas on an average of one out of every three days.

Herrera of COPEI has promised to lower government spending and the levels of waste and corruption that have plagued the Perez administration. Even Pinerua, who comes from Perez' political party but was not the President's first-choice candidate in an AD primary last year, has subtly attacked the more serious administration problems.

One of the biggest problems the new president will face is the likelihood that he will not commend the congressional majority that Perez did. While congressional elections will also be held today, Venezuelans will vote only for the party of their choice, with party caucuses later selecting the actual members of the House of Deputies and Senate.

A lack of simple majority for either of the front-runners could mean that the eight other marginal parties, whose candidates range from a former leftist guerrilla to a pro-military rightist with the endorsement of exiled former dictator Marcos Perez Jimenez, can gain leverage as power-brokers.

Chief among the third-party candidates are Diego Arria, 40, a political maverick who served both the Perez government and that of Perez' COPEI predecessor Rafael Caldera before forming his own political party last year, and Socialist Jose Vicente Rangel.

A frenzy of campaign activity ceased abruptly last Thursday night under a law ending all preelection politicking three days before the vote. The candidates spent an estimated $100 million. Much of the money went to television and newspaper ads in the fashion of U.S. political campaigns.

Both AD and COPEI hired U.S. political advisers and publicity specialists who played a big part in packaging the candidates. COPEI hired David Garth, who ran successful campaigns for both New York Mayor Edward Koch and Gov. Hugh Carey this year.

Democratic Action, which spent an estimated $40 million to get Perez elected in 1973, hired veteran U.S. campaign specialists Joseph Napolitan and Clifton White. Third-party candidate Arria enlisted the services of Carter pollster Patrick H. Cadell.

Results are expected Monday.