Definitely before! Especially in the humanities, it is important to get in touch with somebody in your potential department. Otherwise, unless you can afford to visit on your own, how will they be able to attach a person to an application? Plus, professors or DGS's usually have really great advice. I saved the money I would have spent on an application fee to Cornell because the faculty didn't actually suit my particular interests. Of course... I was still tempted to apply. It's also helpful to be able to mention some particularly good insight a professor had on your potential project in your SOP.
This is mostly all personal opinion, but I hope it helps!