UK brewer Marston's has agreed to buy the Charles Wells brewery, as well as the firm's beer brands, for GBP55m (US$71m).