We study correlation properties of the magnitude and the sign of the increments in the time intervals between successive heartbeats during light sleep, deep sleep, and REM sleep using the detrended fluctuation analysis method. We find short-range anticorrelations in the sign time series, which are strong during deep sleep, weaker during light sleep and even weaker during REM sleep. In contrast, we find long-range positive correlations in the magnitude time series, which are strong during REM sleep and weaker during light sleep. We observe uncorrelated behavior for the magnitude during deep sleep. Since the magnitude series relates to the nonlinear properties of the original time series, while the signs series relates to the linear properties, our findings suggest that the nonlinear properties of the heartbeat dynamics are more pronounced during REM sleep. Thus, the sign and the magnitude series provide information which is useful in distinguishing between the sleep stages.