Roy Keane has quit international football on the advice of doctors in a bid to prolong his Manchester United career.