Giant dipole resonance in proton capture reactions using an extended quantum molecular dynamics model