Contracts don't determine what is legal and not legal. If the said person is found out then they would be in breach of contract and could be fired or sued. They would not earn themselves a criminal record.
Getting sued is not getting convicted of something.
Anti-moonlighting clauses are nonsense.