A new magnetoelectric effect is predicted originating from the interlayer exchange coupling between two ferromagnetic layers separated by an ultrathin ferroelectric barrier. It is demonstrated that ferroelectric polarization switching driven by an external electric field leads to a sizable change in the interlayer exchange coupling. The effect occurs in asymmetric ferromagnet/ferroelectric/ferromagnet junctions due to a change in the electrostatic potential profile across the junction affecting the interlayer coupling. The predicted phenomenon indicates the possibility of switching the magnetic configuration by reversing the polarization of the ferroelectric barrier layer.