Retailer WHSmith has agreed to sell its UK high street chain to Modella Capital and will rebrand as TGJones.