REM. 
It's the stage of sleep where a day's memories are processed and stored. Anything that you've deemed to be "important" will be cataloged somewhere in your brain while the rest will be forgotten.
If you skimp out on REM - say by not getting enough sleep- you'll negatively impact this process and won't be able to remember anything, right? I mean, that's what we've been saying.
Maybe.
This is Your Brain on REM
The scientific theory that sleep in general benefits memory performance is well established, but is has changed over the years.
Early sleep studies claimed that depriving people of REM sleep impairs certain kinds of memory formation, namely declarative memory, the next day.
In addition, studies done on insomniacs noticed that REM sleep was seen to correlate with comparatively higher levels of memory consolidation, most likely compensating for lower levels of Deep sleep.
Since then, the best evidence for memory consolidation during REM comes from neuroimaging (PET) scans.
Red = most active, Purple = least active