AMENDED AND RESTATED REGISTRATION RIGHTS AGREEMENT by and between ATLAS RESOURCE PARTNERS, L.P. and