The POINT-AGAPE Survey - I. The variable stars in M31