In my own experience, masturbating before sleep creates more sexual dreams than normal. Perhaps this is to do with pornography, though.