The ban is the latest attack by Trump on media outlets that he perceives as unfavourable to his administration.