The Obama administration is engaged in preliminary talks with the European Union and China to settle a dispute over trade in solar-energy equipment and avoid a conflict among the world’s largest economies, according to people familiar with the discussions.