I can't quite pinpoint this problem.
About 6 months ago I purchased an incredibly cheap computer case, and an incredibly cheap power supply from NewEgg.
After I overloaded the powersupply 'til the point it was literally smoking. I removed some of the extra video cards (this was a gpu cluster computer) and proceeded as usual.
This one incredibly annoying thing kept happening. Whenever I would go to plug in my computer monitor to the back of the computer... there was a 50/50 chance the machine would shut off right away.
I immediately thought it must be the power supply. Mainly because I had driven it to the point of smoking. So I removed the power supply and replaced it with a high quality, gold+ Antec PSU (and changed out the motherboard, cpu and ram while I was at it).
Low and behold, the computer persists to switch off miraculously simply by touching it.
Again, this does not happen all of the time. I have noticed it depends where I touch it exactly. Towards the top of the case (where the power and rest buttons reside) is where it is most vulnerable.