Royal Mail and unions 'reach agreement'