This is an issue I have with using a snorkel and one I've discussed with instructors who have many years of experience. Especially in the class situation where you may not have the option of putting the snorkel in your pocket, you must come up with a strategy which minimizes the issue.
The best one I've heard is this:
When you reach for your inflator, turn your head to "look" for it -- that is, turn your head to the left. This raises the snorkel and places it farther away from the inflator. As you get more comfortable with the gear, you'll find you will know where everything is and the problem will slowly disappear.
BTW, the only time I have a snorkel on my head is when I'm in the pool teaching -- otherwise, either no snorkel anywhere OR it is in my pocket. Did I mention that I don't believe snorkels have much use in Scuba? (MOD of snorkel -- 6 inches!)