Cosmological inference using only gravitational wave observations of binary neutron stars