Rouhani says Iran wants dialogue, working to ‘prevent war’