Optimised design of actively shielded NMR magnets