BP will cut 5,000 jobs after reporting "disappointing" profits as margins were squeezed and costs rose.