Barack Obama said any provocative actions by North Korea would have "serious consequences" after the reclusive North confirmed it had conducted its fifth nuclear test.