Japanese authorities have issued a tsunami warning after an earthquake was detected off the country's northeastern coast.