Compact starbursts in ultraluminous infrared galaxies