Modelling of the upper atmosphere of gas-giant exoplanets irradiated by low-mass stars