The efficient management of energy communities relies on the solution of the "prosumer problem", i.e., the problem of scheduling the household loads on the basis of the user needs, the electricity prices, and the availability of local renewable energy, with the aim of reducing costs and energy waste. Quantum computers can offer a significant breakthrough in treating this problem thanks to the intrinsic parallel nature of quantum operations. The most promising approach is to devise variational hybrid algorithms, in which quantum computation is driven by parameters that are optimized classically, in a cycle that aims at finding the best solution with a significant speedup with respect to classical approaches. This paper provides a reformulation of the prosumer problem, allowing to address it with a hybrid quantum algorithm, namely, Quantum Approximate Optimization Algorithm (QAOA), and with a recent variant, the Recursive QAOA. We report on an extensive set of experiments, on simulators and real quantum hardware, for different problem sizes. Results are encouraging in that Recursive QAOA is able, for problems involving up to 10 qubits, to provide optimal and admissible solutions with good probabilities, while the computation time is nearly independent of the system size.