Controlling beam loading is essential to produce large-charge high-quality electron beams in laser wakefield acceleration. The bunch shape in the longitudinal direction is a key factor to optimize beam loading. However, how to generate an electron beam with an appropriate shape is always a difficult problem to solve. In the present paper, indirect manipulation on the bunch shape is realized by tuning the laser profile. This is because that the bunch shape relies on the initial transverse position of electrons, which can be controlled by the laser profile in the optical injection scheme. Based on this indirect manipulation method, we find that by reducing the focal spot size of the injection pulse and thus effectively inhibiting off-axis electron injection, the electron beam shape gradually changes from down-ramp to flat-top, which is more favorable for optimizing beam loading. Consequently, we use a cigar-like injection pulse to generate electron beams with large charge and low energy spread. In this manner, an electron beam with 0.1% energy spread,
214
p
C
total charge and
0.3
π
m
m
⋅
m
r
a
d
emittance can be produced.