Optimal control problems of phase relaxation models