Russia, Iran and Iraq have been monitored for several months; Justice Minister says the program was “legal”