Optical properties of charged nonspherical particles determined using the discrete dipole approximation