They can take you to court to recover the debt and would almost certainly win given the contract. The short answer is you cannot use your deposit to pay your rent as you don't control that money any more, and whether you were due your deposit back is a separate tenancy matter.