A powerful earthquake struck off the western coast of Sumatra in Indonesia.