Magnetic-reconnection-heated corona in active galactic nuclei: refined disc–corona model and application to broad-band radiation