The joint statement from the FBI and other federal agencies says hackers had sought access to people from both presidential campaigns.