An "illegal contract" is the agreement in which subject matter relates to an illegal purpose that violates the law.