We investigate the effect of stellar density on the ultraviolet (UV) emission from M31's globular clusters (GCs). Published far-UV (FUV) and near-UV (NUV) colours from Galaxy Evolution and Explorer (GALEX) observations are used as a probe into the temperature of the horizontal branch (HB) stars in these clusters. From these data, we demonstrate a significant relationship between the core density of a cluster and its FUV–NUV colour, with dense clusters having bluer UV colours. These results are consistent with a population of (FUV bright) extreme-HB (EHB) stars, the production of which is related to the stellar density in the clusters. Such a relationship may be expected if the formation of EHB stars is enhanced in dense clusters due to dynamical interactions. We also consider the contribution of low-mass X-ray binaries (LMXBs) to the integrated FUV luminosity of a cluster. We note that two of the three metal-rich clusters, (recently) identified by Rey et al. as having a FUV excess, are known to host LMXBs in outburst. Considering the FUV luminosity of Galactic LMXBs, we suggest that a single LMXB is unlikely to produce more than 10 per cent of the observed FUV luminosity of clusters that contain a significant population of blue-HB stars.