Six Democratic presidential candidates, in a sharp rejection of a controversial aspect of Reagan administration foreign policy, yesterday endorsed legislation to limit trade and economic ties to South Africa because of that country's racial policies.

Rep. Stephen J. Solarz (D-N.Y.), sponsor of the measure, made public a letter from the Democratic presidential hopefuls to legislators in advance of a House vote scheduled for Monday.

"It is time now to back up our opposition to apartheid," South Africa's racial segregation system, "with deeds as well as words," said the Democratic candidates in backing a measure that would bar the importation of krugerrands and other South African gold coins, forbid U.S. bank loans to the South African government and require U.S. firms in South Africa to practice non-discrimination.

Signing the letter were Sens. Alan Cranston (D-Calif.), John Glenn (D-Ohio), Gary Hart (D-Colo.) and Ernest F. Hollings (D-S.C.), former vice president Walter F. Mondale and former senator George McGovern.

The Democrats' letter criticized the administration's policy of "constructive engagement" with South Africa, charging that it "has produced neither substantial democratization within South Africa nor a settlement in Namibia, which South Africa continues to occupy in defiance of international law."

State Department officials have defended "constructive engagement," saying it has helped to produce a ferment within South Africa that promises gradual change and that it has helped to bring about major progress in the international negotiations regarding Namibia, formerly South-West Africa.

Negotiated independence for Namibia is still stymied, however, by the unwillingness of neighboring Angola to commit itself to send home its Cuban troops. The administration has insisted that withdrawal of the Cubans from Angola is necessary to bring about South African withdrawal from Namibia.

The administration has opposed the measure endorsed by the Democratic candidates, charging that such reprisals against South Africa would be ineffective economically and, in the political sphere, would reduce U.S. leverage to promote regional cooperation and peaceful change.

Solarz' proposals were added by the House Foreign Affairs Committee to the Export Administration Act pending in the House. Endorsement of the proposals by the six Democratic presidential candidates is expected to increase the already substan- tial prospect of passage in the Democratic-controlled House. Passage in the Republican-controlled Senate is considered doubt- ful.

On the political level, opposition to administration policy regarding South Africa is likely to be a popular issue for Democratic candidates, particularly those with large black constituencies.

President Reagan has criticized apartheid as repugnant to American values, while at the same time backing the constructive-engagement policy.

The failure to bring about a diplomatic settlement in Namibia, which seemed to be a promising possibility until a few months ago, has made U.S. policy more difficult to defend politically. As frustration has grown in Congress and the 1984 elections draw near, South Africa increasingly has become a target on Capitol Hill.

A seventh declared Democratic candidate, former Florida governor Reubin Askew, did not sign the letter.