A magnitude 7.1 earthquake struck southern Japan, killing at least 34 people and causing widespread damage.