Angola and Cuba have agreed in principle that several dozen U.N. peacekeepers will monitor the withdrawal of 50,000 Cuban troops from Angola, a senior U.N. official said Friday.

The official, who is involved in plans for a peace settlement in southwestern Africa, said the force probably will number no more than 50 and will be largely symbolic. He spoke on condition of anonymity.He said the force would be separate from the 7,500 U.N. peacekeepers assigned to monitor South Africa's withdrawal next year from South-West Africa, also known as Namibia.

Marrack Goulding, U.N. undersecretary-general for peacekeeping operations, met with visiting Cuban and Angolan military officials this week about the matter.

U.S. spy satellites are expected to provide intelligence data about the Cuban witdrawal demanded by South Africa.

Cuba, Angola and South Africa signed an agreement Tuesday involving Cuban and South African withdrawal and independence for Namibia, which South Africa has controlled for 73 years. Cuban troops are to be withdrawn over 30 months, with half gone by Nov. 1, 1989.

The independence program for Namibia is to begin April 1, and 3,000 Cuban troops are to be out of Angola by that date. Namibian elections are planned for Nov. 1.

Angolan President Jose Eduardo dos Santos affirmed his country's commitment to the peace efforts, Angola's official news agency ANGOP reported Friday.

In a report monitored in Lisbon, ANGOP said dos Santos spoke Thursday in the Atlantic archipelago nation of Cape Verde.

Dos Santos planned to visit Cuba for four days, then fly to New York for the formal signing of the peace accord on Dec. 22.

Cuban troops went to Angola, after the Portuguese colony became independent in 1975, to help the Marxist government repel the attacks of guerrillas backed by South Africa. The South Africans insisted on withdrawal as a condition for their cooperation with the 10-year-old U.N. independence plan for Namibia.

The Reagan administration made linkage of the withdrawal and Namibian independence a keystone of its southern Africa policy.