Magnetic higher-mass stars in the early stages of their evolution