Optimized spectral collection efficiency obtained in diamond-based ultraviolet detectors using a three electrode structure