I have a metal light switch box that is mounted on the outside of a wall and I would like to set a magnetic flashlight on it. Is electricity adversely affected by having a magnet near it?
Short answer: No.
Long answer: Nnnooooooo.
Serious answer: A permanent magnet, even one a thousand times stronger than the one holding your flashlight in place, placed near your home wiring but not moving has no effect on the circuit at all. A permanent magnet as small as the one on your flashlight, when moved around near your home wiring (eg. when you take the flashlight and put it back), will theoretically generate tiny surges of current in the wires. In order to measure those surges you would have to be a very careful physicist.
A magnet moved around near a metal junction box will generate tiny surges of current in the box walls. In order to measure those surges you would have to be a very careful physicist with pernicious insomnia. Theoretically a tiny amount of magnetic influence makes its way into the interior of the junction box, via screw holes etc. In order to measure those surges you would have to be a very careful physicist who is going through a bad divorce and expects to never sleep again.
All this is of no practical consequence. Any magnet you would have around the house cannot interfere with your domestic electric supply.
Won't make a difference
For one thing, the steel box is going to weaken the magnetism.
But even if the magnet were in direct contact, it still wouldn't have an effect. Because you don't have anything like a transformer or motor winding there.
(To answer the inevitable question, magnets can reduce the effectiveness of a transformer core. Imagine you're jogging around your oval 1/4 mile high school track, round and round. Then the glee club sets up a stage, intruding on one end and forcing you to shortcut, that's like static magnetism intruding upon and saturating a transformer core. Now it's not 1/4 mile anymore. Thieves stick magnets on old style electric meters hoping it would under-report how much power they used.)
Going to tack-on an answer.
Even though your specific question has been answered 100% correctly, I want to point out that you should never stick anything magnetic to a computer or other delicate electronics.
When putting the light on the junction/switch box the amount of EMI generated is so tiny it really can't hurt anything.
When putting that magnet on a computer or similar, it could really mess things up.
First it could effect magnetic storage (tapes, and hard drives for example), and in some cases it could alter the "signal" voltage in, for example, Ethernet cables enough to cause issues. Mostly though, the magnet, could, if strong enough, alter the voltages enough on the circuit lines of delicate electronics enough to cause issue.
The most common effect is likely to be distortion of other magnetic fields though, and not that of actual voltage.
That said, it's perfectly fine to stick where your describing, I just wanted to pop in and make sure it's clear that it's not ok to sick on, say, the back of a plasma TV, or your favorite collection of floppy disks.
In general no, it will be fine.
I would however avoid putting strong magnets near electricity meters. The accuracy on some models can be affected by the magnetic field, and others have sensors that will indicate a "tampering event" to the electricity company if they detect a strong field.