Multiwavelength energy distributions of ultraluminous IRAS galaxies - I. Submillimetre and X-ray observations