I believe United and Spanair share miles. I know they have a codeshare from IAD to MAD. You can accrue and use miles on this route. I believe that the other Spanair routes are included as well. I beelieve this link might help you -
www.ual.com/site/primary/0,10017,2901,00.html