In this work we carry out a comprehensive investigation of structural and optical effects in GaNAsP nanowires (NWs), which are novel materials promising for advanced photovoltaic applications. Despite a significant mismatch in electronegativity between N and As/P atoms, we show that incorporation of nitrogen does not degrade structural quality of the nanowires and the fabricated NW arrays have excellent compositional uniformity among individual wires. From temperature-dependent photoluminescence (PL) measurements, statistical fluctuations of the alloy composition are shown to lead to localization of photo-excited carriers at low temperatures but do not affect material properties at room temperature. According to time-resolved PL measurements, the room-temperature carrier lifetime increases in the GaNAsP NWs as compared with the GaAsP NWs, which indicates reduced non-radiative recombination. Moreover, in spite of the very low N content in the studied NWs (up to 0.16 %), their bandgap energy can be tuned by more than 100 meV. This is accompanied by about 30% reduction in the temperature dependence of the bandgap energy. The presented results demonstrate that alloying of GaAsP with nitrogen provides an additional means of design optimization, beneficial for, e.g., NW-based intermediate band solar cells that are highly dependent on the optimum bandgap structure.