Magnetoelectric memory function with optical readout