US Senator Bob Menendez has announced his resignation after being found guilty of bribery and acting as a foreign agent for Egypt.