Microwave-to-optical transduction with erbium ions coupled to planar photonic and superconducting resonators