The chiral transition in a magnetic background: finite density effects and the functional renormalization group