The diversified conglomerate Wesfarmers has reached an agreement with the board of Australian retail group Coles for a recommended cash and share takeover offer totalling around A$22bn (US$17.7bn).