No, a contract does not have to be in writing to be valid.

A contract can be oral, written or implied.

What is important is for all the elements of entering into contract must be present. These elements include offer, acceptance, an exchange of consideration and an intent to  be bound.