Marks and Spencer and npower have signed the UK retail sector's biggest renewable energy contract.