Extensions of tempered representations of reductive p-adic groups