On the evolution of epistasis I: diploids under selection