Electricity (more precisely electric field) and
magnet (let's say magnetic field) are two sides of
the same coin. In modern physics, electric
and magnetic field are written in the same
equation. Changing electric field (time-dependent
electric field) will generate magnetic field, and
changing magnetic field (time-dependent magnetic
field) will generate electric field.
Understanding the relation between electric and
magnetic field was the motivation for Einstein to
invent relativity. His first paper on this subject
was "ON THE ELECTRODYNAMICS OF MOVING BODIES".
To see the effect of electric field on magnet,
you can put a compass next to an electric cable.
When you turn on and off the electric current, the
compass will change its alignment.