I just tilted up my MacBook Pro to look at a piece of paper underneath it, and the lid touched a bottlecap on the table, clinging to it quite strongly. The whole top edge of the laptop (on the outside) is magnetized? What's this from?
The magnet in the clamshell activates a switch, in order to let the device know it should go to sleep.
This support article refers to the magnets in the clamshell: http://support.apple.com/kb/TS2917
The magnet is used in conjunction with a device called a Hall effect sensor in order to detect whether the lid is closed. Devices containing magnets, including many smartphones, may trigger this sensor and cause the system to sleep.
I can't help but laugh at this line (source):
For best results, do not stack computers.
Depending on your model, the magnets are in different locations.
On the older style Aluminum MacBook Pros there are magnets to pull the latches down from above the monitor so it closes securely when you close the lid.
If you are using a Unibody MacBook Pro (current generation) then there are magnets around the display to help keep it closed and to trigger a switch to notify the computer to go to sleep.