An earthquake with a magnitude of 5.6 shakes northeastern Taiwan's coastal town, with tremors felt in the capital Taipei.