Prime ministers of the Soviet Union and its communist allies signed a 15-year agreement today to cooperate in upgrading the levels of technology throughout their economies.

The 10 countries of the Comecon economic grouping specified the goal of modernization in electronics, nuclear power, automation, biotechnology and use of new industrial materials.

At a press conference, Yevgeny Velikhov, vice president of the Soviet Academy of Sciences, described the two-day session ending here today as an effort "to increase the productivity of labor and to raise the spiritual and cultural life of the people." Other Soviet scientists said the program is comparable in some ways to the French-initiated Eureka plan for technological development in Western Europe.

The program is expected to achieve a twofold increase in labor productivity and "sharply reduce" consumption of energy and raw materials in Comecon, said a report by the official Tass news agency.

Yesterday, representatives of the member countries signed an agreement to expand the use of nuclear power in the Comecon countries. Western analysts characterize that effort as a way of decreasing dependency on Soviet oil supplies. Output of Soviet oil has dwindled in the past two years.

The Comecon countries also agreed to create Interrobot, a six- nation organization coodinating production of robots in the Soviet Bloc. Comecon includes the Soviet Union, Bulgaria, Czechoslovakia, East Germany, Hungary, Poland, Romania, Mongolia, Cuba and Vietnam.