Optimization problems with equilibrium constraints