This seems like a common sense type of question (why don't you sleep on the floor when there's a sofa available, and why don't you sleep on a sofa when there's a comfortable bed available?), and it turns out it is.
According to a small study done recently in a sleep laboratory,
Information concerning the stages of sleep is one of the most important clues for determining the quality of a particular mattress. The purpose of this study was to determine the effects of mattress type on sleep quality by measuring skin temperature, by using a subjective mattress rating system, and through the use of Polysomnogram (the recording of brain waves through electroencephalography, the generation of a video graphic record of eye movement, chin movements, and heart rhythm.) ...The percentages of wake after sleep onset and stage 1 sleep were lower when subjects slept on “comfortable” mattresses. Subjective ratings of sleep quality paralleled recorded sleep data.
"Comfortable" is the key word here. How comfortable a mattress is depends on personal preferences, position of sleep (side sleepers vs back/stomach), presence/absence of low back pain, heat retention properties of mattress/bedding, etc.
While this would seem like an important area to study, there has been very little in the way of well-developed recent studies.
Most of the recent studies on mattress types are concerned with the prevention of SIDS.
Quantitative effects of mattress types (comfortable vs. uncomfortable) on sleep quality through polysomnography and skin temperature