The US has banned EU officials from getting American visas as it criticises online laws that it says harm free speech.