The larger the resistor the better but 3K will be OK if using a IRL540N or similar (give it a try and see what happens)
The way the resistors are connected forms a voltage divider. So the smaller the second resistor the less voltage gets to the mosfet.
With a 10k resistor the amount of voltage lost/diverted is negligible
5v in, R1 = 220, R2 = 10,000. V out is around 4.9v.
With a 3K resistor
5v in, R1 = 220, R2 = 3,000. V out will be around 4.6V
The IRL540N is OK for 4.0v so 4.6v will be ok.
RDSon @ 5.0V = 0.053 ohm
RDSon @ 4.0V = 0.063 ohm
You could reduce the 220 ohm resistor to 100 ohm. This is work OK and increase v out slightly.
V in 5, R1 = 100, R2 = 3000, V out will be around 4.8v