Manchester City moved to within eight points of Premier League leaders Chelsea following a hard-fought win over Bournemouth.