A magnitude-6.4 earthquake has struck near the coast of Taiwan, killing two hotel employees and injuring 144 other people.