NASA spacecraft rams into asteroid in defence test