The United States and the Philippines signed a five-year renewal of their bases agreement today, increasing by $400 million the American payment of $500 million being provided during the five years of the current pact that expires next year.

In a letter to Philippine President Ferdinand Marcos, President Reagan said the renewal underlined "the close and historic ties linking our two countries, and will contribute to further strengthening the peace and security of the western Pacific."

Reagan's letter was described as a "best effort" pledge to win congressional approval of the $900 million compensation for the use of Clark Air Base and Subic Bay Naval Base, the two largest U.S. installations overseas, for five years starting in October 1984.

Culminating a two-month review process, U.S. Ambassador Michael Armacost and the Philippine ambassador to Washington, Benjamin Romualdez, signed the agreement in a ceremony at the presidential palace.

The proposed compensation is broken down into $475 million in economic assistance, $125 million in military aid grants and $300 million in military sales credits carrying concessionary interest rates for 20 years.

Marcos said the bases agreement is to the advantage of both countries, warning that it would be dangerous if the U.S. military presence were removed from Asia and the Pacific. The resultant tilt in the balance of power "could very well pose a real danger to all the small countries in the region, including the Philippines," he said.

Without giving specifics, Marcos said he had received encouragement from other Asian countries he had consulted on maintaining the bases. He said that the ideal of a zone of peace, freedom and neutrality remains one of the abiding faiths of the Association of Southeast Asian Nations, consisting of Indonesia, Singapore, Thailand, Malaysia and the Philippines. But, he said, "until we can ourselves defend that neutrality and that freedom and peace, it will be necessary to depend upon the time-honored principle of maintaining the balance of power in the region."

Amendments to the 1979 bases agreement give the Filipino commanders more say in the running of Clark and Subic bases. The United States is obliged to inform the Philippines on the levels of personnel and equipment.

The amendments call for more consultations although the United States retains unhampered use of the bases. There is to be prior consultation if the United States wants to store long-range missiles at the bases.

A joint committee is to be set up to manage the implementation of the agreement, which includes new provisions covering taxes and criminal jurisdiction of the 14,000 U.S. personnel here.

About 50 Filipinos carrying placards protested the new agreement in front of the U.S. Embassy this afternoon.