Surface and corner magnetizations in the two-dimensional Ising model