Okay, I underwent a couple of tests and I can say that on days that I did not masturbate before going to sleep I was able to recall a dream. Which I couldn't on evenings that I did do it.

However! My recall is really badly and could easily be influenced by other factors.