ajor West German banks, ignoring U.S. sanctions against the Soviet Union, formally agreed today to extend up to $1.6 billion in credits to the Soviets for construction of a pipeline to carry Siberian natural gas to Western Europe.

The accord between the banks and the Soviet government, signed in Leningrad, provided further evidence of West German determination to proceed with the controversial project despite U.S. objections and the practical obstacles placed in its way by President Reagan. The pipeline has become a major issue between the United States and its European allies.

Most of the West German credits are for the purchases of compressor stations for the 3,500-mile pipeline scheduled to open in 1984.

Reagan's ban on export of American equipment for the pipeline had been extended last month to foreign subsidiaries and licensees of U.S. companies and specifically affects large 25-megawatt turbines used for compressor stations. Companies in West Germany, France, Britain and Italy are involved in the Siberian pipeline and could lose major contracts because of the U.S. action.

The West German government had made it clear from the start that it supports the project and the agreement signed today provides that Bonn will guarantee 85 percent of the financing. Without such a backstop, the banks would have been reluctant to make the loans, which West German sources said are repayable over eight years at 7.8 percent annual interest.

Last month's Western economic summit conference in Versailles had agreed on a policy of "commercial prudence in limiting export credits" to the Soviet Union and Eastern Europe. But the United States had failed to win a specific commitment to require at least 12.25 percent interest on such loans.

West German diplomatic sources here said the Bonn government still hopes to persuade the Reagan administration to abandon its punitive actions against Moscow and avoid serious discord in the Western alliance. West German Chancellor Helmut Schmidt is scheduled to visit the United States next week for a brief vacation and was expected to meet with the new secretary of state, George Shultz, to press the European case.

If Washington fails to accommodate European concerns on this issue, a West German source here said, "then we may simply be forced to ignore the sanctions."

So far, only Prime Minister Margaret Thatcher has directly challenged the U.S. trade restrictions over the Siberian pipeline. London has invoked a 1980 law, known as the Protection of Trading Interests Act, to assert that Reagan's sanctions were damaging British commerce. The British law would enable Thatcher to take any legal steps available to overturn the embargo.

In Bonn, the Economics Ministry issued a statement today saying the government "has no clear legal basis at its disposal for forbidding adherence to the embargo on the gas pipeline deal." But it added that the government was studying the political, legal and economic implications of the U.S. action.

The Soviet government news agency Tass, in announcing the signing of the agreement today, described it as "evidence of the steadily broadening economic and trade links between the Soviet Union and the Federal Republic of Germany."

A statement issued by Deutsche Bank, the leader of the bank consortium, said the agreement would allow the Soviet Union to draw up to $1.6 billion before the end of the year for West German equipment and services for the pipeline. About $1.1 billion is to be used to pay for equipment already ordered.

The line of credit agreed on today does not cover Soviet purchases of West German pipe used in the project.

The firms involved in the project to link the largest Soviet natural gas field at Urengoi, in Siberia, to western sections of the country include AEG and Telefunken of West Germany, Italy's state-owned Nuovo Pignone, Alsthom-Atlantique of France and the British engineering firm of John Brown and Co.

Representatives of John Brown and AEG-Telefunken were here last week to discuss with Soviet officials ways to proceed with the project. German sources said a joint venture by the Russians and West Europeans was being considered in which the Soviets would build turbines at West European facilities independent of U.S. licenses.

The European companies manufacture the large turbines under license to General Electric. The key issue is turbine blades that are supplied by GE and manufactured in the United States.

In the protocols of the two-day Leningrad session of the Soviet-West German bank commission, both sides confirmed their determination to cooperate in the credit and insurance fields and asserted readiness to press for "realization of major and long-term projects." The protocol appeared to reflect West German interest in broader commercial and financial deals with Moscow beyond the Siberian pipeline project.

Today's accord came against a background of continued Soviet condemnation of Reagan's embargo and a domestic campaign to mobilize the population for additional efforts to draw on national resources for completion of other pipeline projects planned for the decade.

The Soviet government announced recently that it has decided to produce its own 25-megawatt turbines for five domestic pipelines. The Western companies had been hoping to supply large turbines for these additional projects before Reagan's embargo.