Have you ever been in the situation where you've poked and prodded at an idea or question for ages, with no solution, gone to bed in a grump, and then upon waking the solution to your query is obvious? Or how about when you're just dropping off to sleep and suddenly an idea jumps into your mind and wakes you up. Some of my best creative ideas have come from dreams that I've had or have cropped up at the point where I'm just about to nod off. That's why I keep a notebook by my bed.
In A Case for Dreaming, Tiffany Shlain discusses the connection between sleep, dreaming and creativity. Have a look.