BP is warning of weak fourth-quarter profits as a result of weaker production, refining margins and trading.