You'll have to pay the full rent for the duration of the contract unless you can agree something with the landlord separately to cancel the agreement. Its more than likely you'll have to pay him a one of sum or pay for the advertising costs of finding/referencing new tenants for the property.