According to Aufbau principle, for multi-electron atoms, in the ground state of an atom, an electron enters the orbital of lowest energy first and subsequent electrons are fed in the order of increasing energies.
For multi-electron atoms, the following sequence is observed for orbitals in the increasing order of energy: 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s.
Here the numbers 1, 2, 3, 4.. indicates shell number. It may be remembered that, though filling of electrons takes place according energy of orbitals, when electrons are removed from the neutral atom, electrons with highest value of n are removed first. So, electrons from 5p or 5s is removed first than from 4f.
To understand lantanide contraction, lets consider an example. If you consider Pd (of 5th period) and Pt (of 6th period), you would expect Pt to have relatively large radii than Pd. In practice, they have roughly same radii. This is because, Pd has 4d electrons and Pt has 5d and 4f electrons. Due to diffused shaped of 4f electrons, they can't shield 5d electrons of Pt. Thus, contracting the size of Pt roughly same as Pd.
Considering your last question, no 4f subshell lies closer to the nuclei than 5s and 5p. For more info, I would suggest you to read this page: Lanthanide Contraction