We have investigated the combined electromagnetic and electrical response of HgCdTe-based pixel detector arrays with different geometries. We have computed the propagation of the optical signal in the detector structure by solving Maxwell's curl equations using a finite-difference time-domain approach. From the field distribution inside the device, we have evaluated the optical carrier generation rate. Using this information in a three-dimensional (3D) numerical model based on a drift-diffusion approach, we have computed the quantum efficiency and photoresponse of a number of pixel geometries. Specifically, we have analyzed the response of both mesa-type and planar detector arrays with and without CdZnTe substrate. Furthermore, the electromagnetic response has also been evaluated for different metal contact dimensions and configurations. It is found that, for mesa-type arrays without the substrate, significant reflection effects take place in the device that lead to resonance peaks in the photoresponse.