Absolutely, you should have a paragraph in your contract that indemnifies you and limits your liability for things like this. Be sure it's written properly and enforceable in your jurisdiction (i.e. consider hiring an attorney if you are at risk for this kind of thing).
A signed contract with such a paragraph in it will help to protect you, but it certainly doesn't guarantee your protection in every circumstance. What the contract will do for you is protect you from being an innocent party to someone else's wrongdoing - but it doesn't relieve you of your own personal responsibilities. If you knowingly contribute to someone's illegal enterprise OR you fail to take reasonable steps to ensure that your clients are legitimate and operating legally, then you could have some liability.
Fortunately that is much easier. You don't have to triple-check each client to make sure they aren't up to something. But, if there were some very obvious signs that they were doing something illegal and you reasonably would be expected to recognize those signs, I'd be very careful!
Ok, I hardly ever feel the need to say this but IANAL (I am not a laywer) so I can't provide legal advice - but that is my understanding of how this kind of thing works.
Anyone with a JD want to jump in?