'Philosophy and the study of the actual world have the same relation to one another as onanism and sexual love' in the German Ideology, here, under the first sub-heading 'Criticism of Religion', second paragraph http://www.marxists.org/archive/marx/works/1845/german-ideology/ch03e.htm