North Korea tells UN it has 'right' to test weapons