Extra space allowed ? If so , given mxn matrix, we maintain two bitmaps one of size m for rows to indicate when a row should be zeroed and similarly for columns. Bitmaps makes it very easy to check in O(1) whether a row or column in already set.
Pass 1: Optimized iteration of matrix , while iterating through the elements of the matrix looking for zeros, when we find a zero is position (i,j) , we can set the corresponding bits in the two bit maps and stop iterating that row for further elements. (after all we are zeroing the whole row and column).
Pass 2: Now we have the two bit maps, loop through them zeroing the rows and columns. If you want to make is very optimal (if zeroing is a costly operation) while zeroing elements in a row you can skip if the corresponding column bit is set, which gets eventually zeroed while walking through columns.
EDIT:
You can do it in one pass with just having a bitmap for columns alone, while iterating through the matrix if you find a zero, set that entire row and column to zeros, set the column bitmap position, and continue with the next row. Skip the columns with bit set while iterating subsequent rows