Greene King plc has agreed a takeover deal for The Belhaven Group plc, which values Belhaven at £187m.