The shallow 6.5-magnitude quake struck Pidie Jaya district in Aceh province at dawn as many in the mainly Muslim region on Sumatra island were preparing for morning prayers.