The solar origin of the January 1997 coronal mass ejection, magnetic cloud and geomagnetic storm