The energy company posted better-than-expected profit despite a weaker contribution from its oil trading division.