I would think that if you form a contract agreeing to do something illegal that it wouldn't qualify as a legal contract and therefore you couldn't be sued for breaching it.