The optimum altitude wold be as low as possible (moderated only by concern about self-harm from the exploding bombs). The higher up you go, the more the chance that cross-winds would blow the bombs off-target.
The main reason that bombers usually flew as high as they could was to avoid Flak, and also I expect to make the defending fighters work harder to climb up to their altitude (the higher a bomber flies, the greater the performance advantage needed by the fighters to make an interception - and the sooner they would run out of fuel).
Tony Williams: Military gun and ammunition
website and discussion
forum