Metric-affine f(R,T) theories of gravity and their applications