The role of magnetism in gravity
The weight of the electromagnet is only a function of its mass and the pull of gravity.  This has nothing to do with magnetism.

However, the total force between the earth and the electromagnet can change when the magnet is turned on.  This is because the earth produces its own magnetic field.  The two magnetic objects will have magnetic forces between them, depending on alignment.  This force on the electromagnet due to it interacting with the earth's magnetic field is in addition to, and independent of, the force between the magnet and the earth due to gravity (the magnet's weight).