The rank of a signed graph in terms of the rank of its underlying graph