I don't have a 5800 but I've had lots of camera phones, with varying degrees of picture quality.
The MP count of course refers only to the size of the image, not the quality. Having said that, the bigger the image file, the more chance you've got of getting a reasonable 7x5 print, if you print them out, but anything over 2-3MP is usually enough.
The lens is a big factor, and the 5800 has a good one.
Unfortunately it only has an LED flash, which isn't as strong as the Xenon, so indoor shots will be poorly illuminated, leading to "noisy" pictures at high ISO's as the lens tries to capture more light.
IMHO the main factor is the quality of the image sensor. You can have the best lens and a powerful flash, but if the sensor is of poor quality then your photos will suffer. Nokia (like most phone companies) use a CMOS sensor which isn't as sensitive to light as the CCD commonly found in dedicated digital cameras. So this makes the strength of the flash even more important.
What I'm trying to say, is it's impossible to compare cameras on phones purely from the spec sheet. You really have to see the photos they take to be able to make a comparison before purchase.
A lot of review sites will show sample pics from phone cameras, if this feature is important.
SV